git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4346 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Spoike 2013-05-07 21:07:14 +00:00
parent 4074f20476
commit cab2869fc7

View file

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifdef __i386__
#define _GNU_SOURCE //we need this in order to fix up broken backtraces. make sure its defined only where needed so we still some posixy conformance test on one plat.
#endif
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <dlfcn.h> #include <dlfcn.h>
@ -670,8 +674,8 @@ static void Friendly_Crash_Handler(int sig, siginfo_t *info, void *vcontext)
#if defined(__i386__) #if defined(__i386__)
//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 //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
struct sig_ucontext *uc = vcontext; ucontext_t *uc = vcontext;
array[1] = uc->uc_mcontext.eip; array[1] = uc->uc_mcontext.gregs[REG_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. //amd64 is sane enough, but this function and the libc signal handler are on the stack, and should be ignored.