From 12a7250defc2455d23b437637944397a7b2d74cb Mon Sep 17 00:00:00 2001 From: Renaud Lepage Date: Fri, 15 Sep 2006 14:06:27 +0000 Subject: [PATCH] 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. --- stepmania/src/RageException.cpp | 2 +- stepmania/src/archutils/Xbox/arch_setup.h | 5 +++++ stepmania/src/global.cpp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index c38b40869f..2b181d912f 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -48,7 +48,7 @@ void RageException::Throw( const char *sFmt, ... ) fflush( stdout ); } -#if defined(WINDOWS) && defined(DEBUG) +#if (defined(WINDOWS) && defined(DEBUG)) || defined(_XDBG) if( IsDebuggerPresent() ) DebugBreak(); #endif diff --git a/stepmania/src/archutils/Xbox/arch_setup.h b/stepmania/src/archutils/Xbox/arch_setup.h index ead219d484..63bb0151bc 100644 --- a/stepmania/src/archutils/Xbox/arch_setup.h +++ b/stepmania/src/archutils/Xbox/arch_setup.h @@ -5,6 +5,11 @@ #include #include +#if defined(_XDBG) +#include +#define IsDebuggerPresent() DmIsDebuggerPresent() +#endif + // Xbox base path #define SYS_BASE_PATH "D:\\" diff --git a/stepmania/src/global.cpp b/stepmania/src/global.cpp index a6bbe1d8ed..4c286083f8 100644 --- a/stepmania/src/global.cpp +++ b/stepmania/src/global.cpp @@ -10,7 +10,7 @@ # include "archutils/Darwin/Crash.h" using CrashHandler::IsDebuggerPresent; using CrashHandler::DebugBreak; -#elif defined(_XBOX) +#elif defined(_XDBG) #else # include #endif @@ -21,7 +21,7 @@ using CrashHandler::DebugBreak; 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( IsDebuggerPresent() ) {