From: Roland McGrath Date: Wed, 28 Dec 2005 05:41:16 +0000 (+0000) Subject: 2005-12-27 Roland McGrath X-Git-Tag: upstream/2.20~3636^2~983 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52abb5ce242502ec54edd095b429c88d3c0d9a3c;p=platform%2Fupstream%2Flinaro-glibc.git 2005-12-27 Roland McGrath * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function. (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison. * sysdeps/alpha/jmpbuf-unwind.h: Likewise. * sysdeps/i386/jmpbuf-unwind.h: Likewise. * sysdeps/mips/jmpbuf-unwind.h: Likewise. * sysdeps/powerpc/jmpbuf-unwind.h: Likewise. * sysdeps/s390/jmpbuf-unwind.h: Likewise. * sysdeps/sh/jmpbuf-unwind.h: Likewise. * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise. * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise. * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise. --- diff --git a/sysdeps/alpha/nptl/jmpbuf-unwind.h b/sysdeps/alpha/nptl/jmpbuf-unwind.h index 5cef8b1..83b7a01 100644 --- a/sysdeps/alpha/nptl/jmpbuf-unwind.h +++ b/sysdeps/alpha/nptl/jmpbuf-unwind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2003. @@ -20,12 +20,23 @@ #include #include #include +#include #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) +static inline uintptr_t __attribute__ ((unused)) +_jmpbuf_sp (__jmp_buf regs) +{ + uintptr_t sp = regs[JB_SP]; +#ifdef PTR_DEMANGLE + PTR_DEMANGLE (sp); +#endif + return sp; +} + #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj)) + ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) /* We use the normal lobngjmp for unwinding. */ #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val) diff --git a/sysdeps/mips/nptl/jmpbuf-unwind.h b/sysdeps/mips/nptl/jmpbuf-unwind.h index 67cc969..9ee0310 100644 --- a/sysdeps/mips/nptl/jmpbuf-unwind.h +++ b/sysdeps/mips/nptl/jmpbuf-unwind.h @@ -19,12 +19,23 @@ #include #include #include +#include #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) +static inline uintptr_t __attribute__ ((unused)) +_jmpbuf_sp (__jmp_buf regs) +{ + uintptr_t sp = regs[0].__sp; +#ifdef PTR_DEMANGLE + PTR_DEMANGLE (sp); +#endif + return sp; +} + #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].__sp - (_adj)) + ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) /* We use the normal longjmp for unwinding. */ #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)