mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
little debugging helper for linux
git-svn-id: https://svn.eduke32.com/eduke32@1485 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a43f31e46c
commit
53418727e9
1 changed files with 17 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <signal.h>
|
||||
#include "sdl_inc.h"
|
||||
#include "compat.h"
|
||||
#include "sdlayer.h"
|
||||
|
@ -224,6 +225,20 @@ void setvsync(int32_t sync)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void attach_debugger_here(void){}
|
||||
|
||||
static void sighandler(int signum)
|
||||
{
|
||||
if (signum==SIGSEGV)
|
||||
{
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
attach_debugger_here();
|
||||
uninitsystem();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// initsystem() -- init SDL systems
|
||||
//
|
||||
|
@ -262,6 +277,8 @@ int32_t initsystem(void)
|
|||
return -1;
|
||||
}
|
||||
|
||||
signal(SIGSEGV, sighandler);
|
||||
|
||||
atexit(uninitsystem);
|
||||
|
||||
frameplace = 0;
|
||||
|
|
Loading…
Reference in a new issue