2003-07-24 08:19:20 +00:00
|
|
|
#include "global.h"
|
2003-09-16 03:20:18 +00:00
|
|
|
#include "RageLog.h"
|
2003-07-24 08:19:20 +00:00
|
|
|
#include "ArchHooks_Unix.h"
|
|
|
|
|
#include "archutils/Unix/SignalHandler.h"
|
2003-11-28 21:34:05 +00:00
|
|
|
#include "archutils/Unix/GetSysInfo.h"
|
2003-07-24 08:19:20 +00:00
|
|
|
|
2003-07-29 21:00:35 +00:00
|
|
|
#if defined(CRASH_HANDLER)
|
2003-07-24 08:19:20 +00:00
|
|
|
#include "archutils/Unix/CrashHandler.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-07-29 21:00:35 +00:00
|
|
|
#include "SDL_utils.h"
|
|
|
|
|
|
|
|
|
|
static void EmergencyShutdown( int signal )
|
|
|
|
|
{
|
|
|
|
|
/* If we don't actually use SDL for video, this should be a no-op. */
|
|
|
|
|
if( SDL_WasInit(SDL_INIT_VIDEO) )
|
|
|
|
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-24 08:19:20 +00:00
|
|
|
ArchHooks_Unix::ArchHooks_Unix()
|
|
|
|
|
{
|
2003-07-29 21:00:35 +00:00
|
|
|
#if defined(CRASH_HANDLER)
|
2003-07-24 08:19:20 +00:00
|
|
|
CrashHandlerHandleArgs();
|
2003-11-11 23:36:31 +00:00
|
|
|
InitializeCrashHandler();
|
2003-07-24 08:19:20 +00:00
|
|
|
SignalHandler::OnClose( CrashSignalHandler );
|
|
|
|
|
#endif
|
2003-07-29 21:00:35 +00:00
|
|
|
|
|
|
|
|
/* Set up EmergencyShutdown, to try to shut down the window if we crash.
|
|
|
|
|
* This might blow up, so be sure to do it after the crash handler. */
|
|
|
|
|
SignalHandler::OnClose( EmergencyShutdown );
|
2003-07-24 08:19:20 +00:00
|
|
|
}
|
|
|
|
|
|
2003-09-16 03:20:18 +00:00
|
|
|
void ArchHooks_Unix::DumpDebugInfo()
|
|
|
|
|
{
|
2003-11-28 21:34:05 +00:00
|
|
|
CString sys;
|
|
|
|
|
int vers;
|
|
|
|
|
GetKernel( sys, vers );
|
|
|
|
|
LOG->Info( "OS: %s ver %06x", sys.c_str(), vers );
|
|
|
|
|
|
2003-09-16 03:20:18 +00:00
|
|
|
#if defined(CRASH_HANDLER)
|
|
|
|
|
LOG->Info( "Crash backtrace component: %s", BACKTRACE_METHOD_TEXT );
|
|
|
|
|
LOG->Info( "Crash lookup component: %s", BACKTRACE_LOOKUP_METHOD_TEXT );
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-24 08:19:20 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2003 by the person(s) listed below. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Glenn Maynard
|
|
|
|
|
*/
|