From 0ca13e14122d9bfd4662e621d16e82325277886d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 10 Jan 2006 08:54:22 +0000 Subject: [PATCH] * sysdeps/powerpc/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/powerpc/jmpbuf-unwind.h: ... here. * sysdeps/alpha/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/alpha/jmpbuf-unwind.h: ... here. * sysdeps/sparc/sparc32/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/sparc/sparc32/jmpbuf-unwind.h: ... here. * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/i386/jmpbuf-unwind.h: ... here. * sysdeps/x86_64/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/x86_64/jmpbuf-unwind.h: ... here. * sysdeps/sh/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/sh/jmpbuf-unwind.h: ... here. * sysdeps/hppa/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/hppa/jmpbuf-unwind.h: ... here, new file. * sysdeps/mips/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/mips/jmpbuf-unwind.h: ... here. * sysdeps/m68k/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/m68k/jmpbuf-unwind.h: ... here, new file. * sysdeps/s390/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/s390/jmpbuf-unwind.h: ... here. * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/ia64/jmpbuf-unwind.h: ... here. * sysdeps/unix/sysv/linux/sparc/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... * sysdeps/sparc/sparc64/jmpbuf-unwind.h: ... here. * sysdeps/ia64/jmpbuf-unwind.h: New file, moved from nptl/. --- ChangeLog | 28 ++++++++++++++++++++++ nptl/ChangeLog | 1 + sysdeps/alpha/bits/setjmp.h | 7 +----- sysdeps/alpha/jmpbuf-unwind.h | 5 ++++ sysdeps/hppa/bits/setjmp.h | 8 +------ sysdeps/hppa/jmpbuf-unwind.h | 26 ++++++++++++++++++++ sysdeps/i386/bits/setjmp.h | 8 ++----- sysdeps/i386/jmpbuf-unwind.h | 5 ++++ .../sysv/linux => sysdeps}/ia64/jmpbuf-unwind.h | 7 +++++- sysdeps/m68k/bits/setjmp.h | 7 +----- sysdeps/m68k/jmpbuf-unwind.h | 25 +++++++++++++++++++ sysdeps/mips/bits/setjmp.h | 8 +------ sysdeps/mips/jmpbuf-unwind.h | 5 ++++ sysdeps/powerpc/bits/setjmp.h | 8 ++----- sysdeps/powerpc/jmpbuf-unwind.h | 5 ++++ sysdeps/s390/bits/setjmp.h | 7 +----- sysdeps/s390/jmpbuf-unwind.h | 7 ++++++ sysdeps/sh/bits/setjmp.h | 7 +----- sysdeps/sh/jmpbuf-unwind.h | 5 ++++ sysdeps/sparc/sparc32/bits/setjmp.h | 7 +----- sysdeps/sparc/sparc32/jmpbuf-unwind.h | 7 +++++- sysdeps/sparc/sparc64/jmpbuf-unwind.h | 5 ++++ sysdeps/unix/sysv/linux/ia64/bits/setjmp.h | 7 +----- sysdeps/unix/sysv/linux/sparc/bits/setjmp.h | 10 -------- sysdeps/x86_64/bits/setjmp.h | 13 +--------- sysdeps/x86_64/jmpbuf-unwind.h | 5 ++++ 26 files changed, 147 insertions(+), 86 deletions(-) create mode 100644 sysdeps/hppa/jmpbuf-unwind.h rename {nptl/sysdeps/unix/sysv/linux => sysdeps}/ia64/jmpbuf-unwind.h (85%) create mode 100644 sysdeps/m68k/jmpbuf-unwind.h diff --git a/ChangeLog b/ChangeLog index 13610a9..8581eee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,35 @@ 2006-01-10 Roland McGrath + * sysdeps/powerpc/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/powerpc/jmpbuf-unwind.h: ... here. + * sysdeps/alpha/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/alpha/jmpbuf-unwind.h: ... here. + * sysdeps/sparc/sparc32/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/sparc/sparc32/jmpbuf-unwind.h: ... here. + * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/i386/jmpbuf-unwind.h: ... here. + * sysdeps/x86_64/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/x86_64/jmpbuf-unwind.h: ... here. + * sysdeps/sh/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/sh/jmpbuf-unwind.h: ... here. + * sysdeps/hppa/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/hppa/jmpbuf-unwind.h: ... here, new file. + * sysdeps/mips/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/mips/jmpbuf-unwind.h: ... here. + * sysdeps/m68k/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/m68k/jmpbuf-unwind.h: ... here, new file. + * sysdeps/s390/bits/setjmp.h (_JMPBUF_UNWINDS): Move macro ... + * sysdeps/s390/jmpbuf-unwind.h: ... here. + * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h (_JMPBUF_UNWINDS): + Move macro ... + * sysdeps/ia64/jmpbuf-unwind.h: ... here. + * sysdeps/unix/sysv/linux/sparc/bits/setjmp.h (_JMPBUF_UNWINDS): + Move macro ... + * sysdeps/sparc/sparc64/jmpbuf-unwind.h: ... here. + * sysdeps/alpha/jmpbuf-unwind.h: New file, moved from nptl/. * sysdeps/i386/jmpbuf-unwind.h: New file, moved from nptl/. + * sysdeps/ia64/jmpbuf-unwind.h: New file, moved from nptl/. * sysdeps/mips/jmpbuf-unwind.h: New file, moved from nptl/. * sysdeps/powerpc/jmpbuf-unwind.h: New file, moved from nptl/. * sysdeps/s390/jmpbuf-unwind.h: New file, moved from nptl/. diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 7db6657..3b82e84 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -9,6 +9,7 @@ * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise. * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise. * sysdeps/x86_64/jmpbuf-unwind.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise. 2006-01-09 Roland McGrath diff --git a/sysdeps/alpha/bits/setjmp.h b/sysdeps/alpha/bits/setjmp.h index 71b7738..7db0dbf 100644 --- a/sysdeps/alpha/bits/setjmp.h +++ b/sysdeps/alpha/bits/setjmp.h @@ -1,5 +1,5 @@ /* Define the machine-dependent type `jmp_buf'. Alpha version. - Copyright (C) 1992, 1997, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1992,1997,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -77,11 +77,6 @@ #ifndef __ASSEMBLY__ typedef long int __jmp_buf[17]; - -/* Test if longjmp to JMPBUF would unwind the frame containing a local - variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ - ((void *)(_address) < (void *) _demangle ((_jmpbuf)[JB_SP])) #endif #endif /* bits/setjmp.h */ diff --git a/sysdeps/alpha/jmpbuf-unwind.h b/sysdeps/alpha/jmpbuf-unwind.h index ca445f8..1faa16f 100644 --- a/sysdeps/alpha/jmpbuf-unwind.h +++ b/sysdeps/alpha/jmpbuf-unwind.h @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame containing a local + variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ + ((void *)(_address) < (void *) _demangle ((_jmpbuf)[JB_SP])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h index 07ea01e..4c8ed07 100644 --- a/sysdeps/hppa/bits/setjmp.h +++ b/sysdeps/hppa/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,10 +37,4 @@ typedef double __jmp_buf[21]; #endif -/* Test if longjmp to JMPBUF would unwind the frame containing a local - variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ - ((void *) (_address) > \ - (void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP]))) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/hppa/jmpbuf-unwind.h b/sysdeps/hppa/jmpbuf-unwind.h new file mode 100644 index 0000000..15cae66 --- /dev/null +++ b/sysdeps/hppa/jmpbuf-unwind.h @@ -0,0 +1,26 @@ +/* Examine __jmp_buf for unwinding frames. HPPA version. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +/* Test if longjmp to JMPBUF would unwind the frame containing a local + variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ + ((void *) (_address) > \ + (void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP]))) diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h index d99a726..7029673 100644 --- a/sysdeps/i386/bits/setjmp.h +++ b/sysdeps/i386/bits/setjmp.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997, 1998, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2001,2003,2005,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,9 +39,4 @@ typedef int __jmp_buf[6]; #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP])) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/i386/jmpbuf-unwind.h b/sysdeps/i386/jmpbuf-unwind.h index ca445f8..039159d 100644 --- a/sysdeps/i386/jmpbuf-unwind.h +++ b/sysdeps/i386/jmpbuf-unwind.h @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h b/sysdeps/ia64/jmpbuf-unwind.h similarity index 85% rename from nptl/sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h rename to sysdeps/ia64/jmpbuf-unwind.h index c6ef5f7..c534472 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h +++ b/sysdeps/ia64/jmpbuf-unwind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2003. @@ -21,6 +21,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame containing a local + variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ + ((void *) (_address) < (void *) (((long int *) _jmpbuf)[0])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ ({ uintptr_t _cfa = (uintptr_t) _Unwind_GetCFA (_context) - (_adj); \ (_cfa < (uintptr_t)(((long *)(_jmpbuf))[0]) - (_adj) \ diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h index 612582a..2d5a082 100644 --- a/sysdeps/m68k/bits/setjmp.h +++ b/sysdeps/m68k/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,9 +42,4 @@ typedef struct } __jmp_buf[1]; -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)->__sp)) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/sysdeps/m68k/jmpbuf-unwind.h new file mode 100644 index 0000000..3490c79 --- /dev/null +++ b/sysdeps/m68k/jmpbuf-unwind.h @@ -0,0 +1,25 @@ +/* Examine __jmp_buf for unwinding frames. m68k version. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)->__sp)) diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h index 5f7c82b..7b94623 100644 --- a/sysdeps/mips/bits/setjmp.h +++ b/sysdeps/mips/bits/setjmp.h @@ -1,5 +1,5 @@ /* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992, 1993, 1995, 1997, 2000, 2002, 2003, 2004, 2005 + Copyright (C) 1992,1993,1995,1997,2000,2002,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -77,10 +77,4 @@ typedef struct # define JB_PC 0 #endif - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp)) - #endif /* _MIPS_BITS_SETJMP_H */ diff --git a/sysdeps/mips/jmpbuf-unwind.h b/sysdeps/mips/jmpbuf-unwind.h index 1ff8fc8..bfa1a64 100644 --- a/sysdeps/mips/jmpbuf-unwind.h +++ b/sysdeps/mips/jmpbuf-unwind.h @@ -21,6 +21,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp)) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h index 6b35fb4..4221300 100644 --- a/sysdeps/powerpc/bits/setjmp.h +++ b/sysdeps/powerpc/bits/setjmp.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2003,2004,2005,2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -72,9 +73,4 @@ typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16))); # endif #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[JB_GPR1])) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/powerpc/jmpbuf-unwind.h b/sysdeps/powerpc/jmpbuf-unwind.h index a6cfea0..34d5e69 100644 --- a/sysdeps/powerpc/jmpbuf-unwind.h +++ b/sysdeps/powerpc/jmpbuf-unwind.h @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)[JB_GPR1])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/bits/setjmp.h index 37f600d..dcac2d2 100644 --- a/sysdeps/s390/bits/setjmp.h +++ b/sysdeps/s390/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2000,2001,2002,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,9 +55,4 @@ typedef struct __s390_jmp_buf { #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15])) - #endif /* __S390_SETJMP_H__ */ diff --git a/sysdeps/s390/jmpbuf-unwind.h b/sysdeps/s390/jmpbuf-unwind.h index ae7491a..23f1e99 100644 --- a/sysdeps/s390/jmpbuf-unwind.h +++ b/sysdeps/s390/jmpbuf-unwind.h @@ -23,6 +23,13 @@ #include #include + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15])) + + /* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual %r15. */ #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ diff --git a/sysdeps/sh/bits/setjmp.h b/sysdeps/sh/bits/setjmp.h index 8ebb5c5..cdc27dc 100644 --- a/sysdeps/sh/bits/setjmp.h +++ b/sysdeps/sh/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1999,2000,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,9 +48,4 @@ typedef struct # define JB_SIZE (4 * 15) #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[0].__regs[7])) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/sh/jmpbuf-unwind.h b/sysdeps/sh/jmpbuf-unwind.h index 4c84c42..a69a465 100644 --- a/sysdeps/sh/jmpbuf-unwind.h +++ b/sysdeps/sh/jmpbuf-unwind.h @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)[0].__regs[7])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/sparc/sparc32/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h index 12250d6..62edd62 100644 --- a/sysdeps/sparc/sparc32/bits/setjmp.h +++ b/sysdeps/sparc/sparc32/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,8 +31,3 @@ #ifndef _ASM typedef int __jmp_buf[3]; #endif - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((int) (address) < demangle ((jmpbuf)[JB_SP])) diff --git a/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/sysdeps/sparc/sparc32/jmpbuf-unwind.h index 83b7a01..c77673f 100644 --- a/sysdeps/sparc/sparc32/jmpbuf-unwind.h +++ b/sysdeps/sparc/sparc32/jmpbuf-unwind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2003. @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((int) (address) < demangle ((jmpbuf)[JB_SP])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/sysdeps/sparc/sparc64/jmpbuf-unwind.h index efb6918..f7eed15 100644 --- a/sysdeps/sparc/sparc64/jmpbuf-unwind.h +++ b/sysdeps/sparc/sparc64/jmpbuf-unwind.h @@ -21,6 +21,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp + 2047) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) diff --git a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h index 8054397..8bd675e 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h @@ -1,5 +1,5 @@ /* Define the machine-dependent type `jmp_buf'. Linux/IA-64 version. - Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1999,2000,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger-Tang . @@ -32,9 +32,4 @@ /* the __jmp_buf element type should be __float80 per ABI... */ typedef long __jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ -/* Test if longjmp to JMPBUF would unwind the frame containing a local - variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \ - ((void *) (_address) < (void *) (((long int *) _jmpbuf)[0])) - #endif /* bits/setjmp.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h index 4fb7c90..360310f 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h @@ -58,11 +58,6 @@ typedef struct __sparc64_jmp_buf } __jmp_buf[1]; #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp + 2047) - #else #if defined __USE_MISC || defined _ASM @@ -75,11 +70,6 @@ typedef struct __sparc64_jmp_buf typedef int __jmp_buf[3]; #endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((int) (address) < demangle ((jmpbuf)[JB_SP])) - #endif #endif /* bits/setjmp.h */ diff --git a/sysdeps/x86_64/bits/setjmp.h b/sysdeps/x86_64/bits/setjmp.h index 1031d50..656fbf7 100644 --- a/sysdeps/x86_64/bits/setjmp.h +++ b/sysdeps/x86_64/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2001,2002,2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -64,15 +64,4 @@ typedef long int __jmp_buf[8]; typedef int __jmp_buf[6]; # endif -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -# if __WORDSIZE == 64 -# define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP])) -# else -# define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP])) -# endif -#endif - #endif /* bits/setjmp.h */ diff --git a/sysdeps/x86_64/jmpbuf-unwind.h b/sysdeps/x86_64/jmpbuf-unwind.h index 2d1187d..c7c0d8a 100644 --- a/sysdeps/x86_64/jmpbuf-unwind.h +++ b/sysdeps/x86_64/jmpbuf-unwind.h @@ -22,6 +22,11 @@ #include #include +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP])) + #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) -- 2.7.4