apparently this is more correct.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4345 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
24040b9ef2
commit
4074f20476
1 changed files with 4 additions and 3 deletions
|
@ -646,7 +646,6 @@ void Sys_Shutdown (void)
|
||||||
#ifdef __linux__ /*should probably be GNUC but whatever*/
|
#ifdef __linux__ /*should probably be GNUC but whatever*/
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
#define __USE_GNU
|
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
#endif
|
#endif
|
||||||
static void Friendly_Crash_Handler(int sig, siginfo_t *info, void *vcontext)
|
static void Friendly_Crash_Handler(int sig, siginfo_t *info, void *vcontext)
|
||||||
|
@ -670,10 +669,12 @@ static void Friendly_Crash_Handler(int sig, siginfo_t *info, void *vcontext)
|
||||||
size = backtrace(array, 10);
|
size = backtrace(array, 10);
|
||||||
|
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
ucontext_t *uc = vcontext;
|
//x86 signals don't leave the stack in a clean state, so replace the signal handler with the real crash address, and hide this function
|
||||||
array[1] = uc->uc_mcontext.gregs[REG_EIP];
|
struct sig_ucontext *uc = vcontext;
|
||||||
|
array[1] = uc->uc_mcontext.eip;
|
||||||
firstframe = 1;
|
firstframe = 1;
|
||||||
#elif defined(__amd64__)
|
#elif defined(__amd64__)
|
||||||
|
//amd64 is sane enough, but this function and the libc signal handler are on the stack, and should be ignored.
|
||||||
firstframe = 2;
|
firstframe = 2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue