Skip to content

Commit

Permalink
Direct exit from the debugger.
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Sep 8, 2014
1 parent d0d2647 commit dd96c83
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions XSFoundation/include/XS/__private/Functions/XSDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ __XSDebugger_MemoryRecord;
*/
XS_EXTERN __XSDebugger_MemoryRecord * volatile __XSDebugger_MemoryRecords;

/*!
* @var __XSDebugger_ExitRequested
* @abstract Whether exit was requested through the debugger
*/
XS_EXTERN bool __XSDebugger_ExitRequested;

#ifdef _WIN32

/*!
Expand Down
2 changes: 2 additions & 0 deletions XSFoundation/source/XS/Functions/XSDebugger/__XSDebugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ __XSDebugger_MemoryRecord * volatile __XSDebugger_MemoryRecords = NULL;
PVOID __XSDebugger_SEH = NULL;

#endif

bool __XSDebugger_ExitRequested = false;
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ void __XSDebugger_Breakpoint( const char * message, __XSDebugger_MemoryRecord *
{
int c;

if( __XSDebugger_ExitRequested )
{
return;
}

#ifndef DEBUG

( void )message;
Expand Down Expand Up @@ -165,6 +170,8 @@ void __XSDebugger_Breakpoint( const char * message, __XSDebugger_MemoryRecord *

case 'q':

__XSDebugger_ExitRequested = true;

exit( EXIT_SUCCESS );

break;
Expand Down

0 comments on commit dd96c83

Please sign in to comment.