delet BUGTRAP
psure this never worked anyways
This commit is contained in:
1 parent
98b105c02a
commit
8e8ef04860
4 files changed
+3
-101
No files matched your search
+3
-12
@@ -138,8 +138,7 @@ static void InitLogging(void)
|
||||
|
||||
if (M_IsPathAbsolute(reldir))
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"%s"PATHSEP, reldir);
|
||||
left = snprintf(logfilename, sizeof logfilename, "%s"PATHSEP, reldir);
|
||||
}
|
||||
else
|
||||
#ifdef DEFAULTDIR
|
||||
@@ -155,13 +154,10 @@ static void InitLogging(void)
|
||||
"."PATHSEP"%s"PATHSEP, reldir);
|
||||
}
|
||||
|
||||
strftime(&logfilename[left], sizeof logfilename - left,
|
||||
format, timeinfo);
|
||||
strftime(&logfilename[left], sizeof logfilename - left, format, timeinfo);
|
||||
}
|
||||
|
||||
M_MkdirEachUntil(logfilename,
|
||||
M_PathParts(logdir) - 1,
|
||||
M_PathParts(logfilename) - 1, 0755);
|
||||
M_MkdirEachUntil(logfilename, M_PathParts(logdir) - 1, M_PathParts(logfilename) - 1, 0755);
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
logstream = fopen(logfilename, "w");
|
||||
@@ -225,11 +221,6 @@ int main(int argc, char **argv)
|
||||
// never return
|
||||
D_SRB2Loop();
|
||||
|
||||
#ifdef BUGTRAP
|
||||
// This is safe even if BT didn't start.
|
||||
ShutdownBugTrap();
|
||||
#endif
|
||||
|
||||
// return to OS
|
||||
return 0;
|
||||
}
|
||||
@@ -236,11 +236,6 @@ int main(int argc, char **argv)
|
||||
// never return
|
||||
D_SRB2Loop();
|
||||
|
||||
#ifdef BUGTRAP
|
||||
// This is safe even if BT didn't start.
|
||||
ShutdownBugTrap();
|
||||
#endif
|
||||
|
||||
// return to OS
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,84 +45,6 @@ BOOL InitDrMingw(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUGTRAP
|
||||
|
||||
typedef void (APIENTRY *BT_SETSUPPORTURL)(LPCTSTR pszSupportURL);
|
||||
typedef void (APIENTRY *BT_SETFLAGS)(DWORD dwFlags);
|
||||
typedef void (APIENTRY *BT_SETAPPNAME)(LPCTSTR pszAppName);
|
||||
typedef void (APIENTRY *BT_SETAPPVERSION)(LPCTSTR pszAppVersion);
|
||||
typedef void (APIENTRY *BT_SETSUPPORTSERVER)(LPCTSTR pszSupportHost, SHORT nSupportPort);
|
||||
|
||||
// BT constant definitions that we use, as given in the docs.
|
||||
#define BTF_DETAILEDMODE 0x01
|
||||
#define BTF_ATTACHREPORT 0x04
|
||||
|
||||
|
||||
static HMODULE g_hmodBugTrap;
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Initialises the Bug Trap exception-handling library. Returns true iff
|
||||
// successful.
|
||||
// --------------------------------------------------------------------------
|
||||
BOOL InitBugTrap(void)
|
||||
{
|
||||
BT_SETFLAGS lpfnBT_SetFlags;
|
||||
BT_SETSUPPORTURL lpfnBT_SetSupportURL;
|
||||
BT_SETAPPNAME lpfnBT_SetAppName;
|
||||
BT_SETAPPVERSION lpfnBT_SetAppVersion;
|
||||
BT_SETSUPPORTSERVER lpfnBT_SetSupportServer;
|
||||
|
||||
// Loading the library installs the exception handler.
|
||||
#ifdef UNICODE
|
||||
g_hmodBugTrap = LoadLibrary(L"BugTrapU.dll");
|
||||
#else
|
||||
g_hmodBugTrap = LoadLibrary("BugTrap.dll");
|
||||
#endif
|
||||
|
||||
// Get the functions.
|
||||
lpfnBT_SetFlags = (BT_SETFLAGS)GetProcAddress(g_hmodBugTrap, "BT_SetFlags");
|
||||
lpfnBT_SetSupportURL = (BT_SETSUPPORTURL)GetProcAddress(g_hmodBugTrap, "BT_SetSupportURL");
|
||||
lpfnBT_SetAppName = (BT_SETAPPNAME)GetProcAddress(g_hmodBugTrap, "BT_SetAppName");
|
||||
lpfnBT_SetAppVersion = (BT_SETAPPVERSION)GetProcAddress(g_hmodBugTrap, "BT_SetAppVersion");
|
||||
lpfnBT_SetSupportServer = (BT_SETSUPPORTSERVER)GetProcAddress(g_hmodBugTrap, "BT_SetSupportServer");
|
||||
|
||||
if (g_hmodBugTrap)
|
||||
{
|
||||
lpfnBT_SetAppName(TEXT("Sonic Robo Blast 2"));
|
||||
lpfnBT_SetAppVersion(TEXT(VERSIONSTRING));
|
||||
lpfnBT_SetFlags(BTF_DETAILEDMODE | BTF_ATTACHREPORT);
|
||||
lpfnBT_SetSupportURL(TEXT("http://www.srb2.org/"));
|
||||
lpfnBT_SetSupportServer(TEXT("srb2.org"), 9999);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Removes the BugTrap exception handler. Safe to call even if BT was never
|
||||
// initialized.
|
||||
// --------------------------------------------------------------------------
|
||||
void ShutdownBugTrap(void)
|
||||
{
|
||||
if (g_hmodBugTrap) FreeLibrary(g_hmodBugTrap);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Simple test to check whether BugTrap is loaded without exposing its
|
||||
// handle.
|
||||
// --------------------------------------------------------------------------
|
||||
BOOL IsBugTrapLoaded(void)
|
||||
{
|
||||
return !!g_hmodBugTrap;
|
||||
}
|
||||
|
||||
#endif // (defined BUGTRAP)
|
||||
|
||||
|
||||
#define NumCodeBytes 16 // Number of code bytes to record.
|
||||
#define MaxStackDump 2048 // Maximum number of DWORDS in stack dumps.
|
||||
#define StackColumns 8 // Number of columns in stack dump.
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
BOOL InitDrMingw(void);
|
||||
#endif
|
||||
|
||||
#ifdef BUGTRAP
|
||||
BOOL InitBugTrap(void);
|
||||
void ShutdownBugTrap(void);
|
||||
BOOL IsBugTrapLoaded(void);
|
||||
#endif
|
||||
|
||||
// called in the exception filter of the __try block, writes all useful debugging information
|
||||
// to a file, using only win32 functions in case the C runtime is in a bad state.
|
||||
LONG WINAPI RecordExceptionInfo(PEXCEPTION_POINTERS data/*, LPCSTR Message, LPSTR lpCmdLine*/);
|
||||
|
||||
Reference in new issue
Block a user