Feature patch: Xbox Crash Handling.

Seems that the Xbox had debugger detection routines and a way to have a Debug Break. this patch activates it.
This commit is contained in:
Renaud Lepage
2006-09-15 14:06:27 +00:00
parent 125fccc33c
commit 12a7250def
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ void RageException::Throw( const char *sFmt, ... )
fflush( stdout ); fflush( stdout );
} }
#if defined(WINDOWS) && defined(DEBUG) #if (defined(WINDOWS) && defined(DEBUG)) || defined(_XDBG)
if( IsDebuggerPresent() ) if( IsDebuggerPresent() )
DebugBreak(); DebugBreak();
#endif #endif
@@ -5,6 +5,11 @@
#include <xgraphics.h> #include <xgraphics.h>
#include <stdio.h> #include <stdio.h>
#if defined(_XDBG)
#include <xbdm.h>
#define IsDebuggerPresent() DmIsDebuggerPresent()
#endif
// Xbox base path // Xbox base path
#define SYS_BASE_PATH "D:\\" #define SYS_BASE_PATH "D:\\"
+2 -2
View File
@@ -10,7 +10,7 @@
# include "archutils/Darwin/Crash.h" # include "archutils/Darwin/Crash.h"
using CrashHandler::IsDebuggerPresent; using CrashHandler::IsDebuggerPresent;
using CrashHandler::DebugBreak; using CrashHandler::DebugBreak;
#elif defined(_XBOX) #elif defined(_XDBG)
#else #else
# include <unistd.h> # include <unistd.h>
#endif #endif
@@ -21,7 +21,7 @@ using CrashHandler::DebugBreak;
void NORETURN sm_crash( const char *reason ) void NORETURN sm_crash( const char *reason )
{ {
#if ( defined(_WINDOWS) && defined(CRASH_HANDLER) ) || defined(MACOSX) #if ( defined(_WINDOWS) && defined(CRASH_HANDLER) ) || defined(MACOSX) || defined(_XDBG)
/* If we're being debugged, throw a debug break so it'll suspend the process. */ /* If we're being debugged, throw a debug break so it'll suspend the process. */
if( IsDebuggerPresent() ) if( IsDebuggerPresent() )
{ {