diff options
author | Alan Modra <amodra@bigpond.net.au> | 2004-09-08 00:17:19 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2004-09-08 09:47:19 +0930 |
commit | 8662eb14c0ef6531d7086ec08f5e52b87c472ede (patch) | |
tree | f6927bd90fe84c682dd04619d255d6355aac36d5 /gcc/config/i386/linux64.h | |
parent | a9e10feb68d5cbc371f581ebca229043b7854fe5 (diff) | |
download | gcc-8662eb14c0ef6531d7086ec08f5e52b87c472ede.zip gcc-8662eb14c0ef6531d7086ec08f5e52b87c472ede.tar.gz gcc-8662eb14c0ef6531d7086ec08f5e52b87c472ede.tar.bz2 |
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
Diffstat (limited to 'gcc/config/i386/linux64.h')
-rw-r--r-- | gcc/config/i386/linux64.h | 126 |
1 files changed, 1 insertions, 125 deletions
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 98536c1..4838cf8 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -69,128 +69,4 @@ Boston, MA 02111-1307, USA. */ #undef NEED_INDICATE_EXEC_STACK #define NEED_INDICATE_EXEC_STACK 1 -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. - Don't use this at all if inhibit_libc is used. */ - -#ifndef inhibit_libc -#ifdef IN_LIBGCC2 -#include <signal.h> -#include <sys/ucontext.h> -#endif - -#ifdef __x86_64__ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - \ - /* movq __NR_rt_sigreturn, %rax ; syscall */ \ - if (*(unsigned char *)(pc_+0) == 0x48 \ - && *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7) \ - { \ - struct ucontext *uc_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &uc_->uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->rsp; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - /* Register 7 is rsp */ \ - (FS)->cfa_reg = 7; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - /* The SVR4 register numbering macros aren't usable in libgcc. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = (long)&sc_->rax - new_cfa_; \ - (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[1].loc.offset = (long)&sc_->rdx - new_cfa_; \ - (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[2].loc.offset = (long)&sc_->rcx - new_cfa_; \ - (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[3].loc.offset = (long)&sc_->rbx - new_cfa_; \ - (FS)->regs.reg[4].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[4].loc.offset = (long)&sc_->rsi - new_cfa_; \ - (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[5].loc.offset = (long)&sc_->rdi - new_cfa_; \ - (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[6].loc.offset = (long)&sc_->rbp - new_cfa_; \ - (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[8].loc.offset = (long)&sc_->r8 - new_cfa_; \ - (FS)->regs.reg[9].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[9].loc.offset = (long)&sc_->r9 - new_cfa_; \ - (FS)->regs.reg[10].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[10].loc.offset = (long)&sc_->r10 - new_cfa_; \ - (FS)->regs.reg[11].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[11].loc.offset = (long)&sc_->r11 - new_cfa_; \ - (FS)->regs.reg[12].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[12].loc.offset = (long)&sc_->r12 - new_cfa_; \ - (FS)->regs.reg[13].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[13].loc.offset = (long)&sc_->r13 - new_cfa_; \ - (FS)->regs.reg[14].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[14].loc.offset = (long)&sc_->r14 - new_cfa_; \ - (FS)->regs.reg[15].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[15].loc.offset = (long)&sc_->r15 - new_cfa_; \ - (FS)->regs.reg[16].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[16].loc.offset = (long)&sc_->rip - new_cfa_; \ - (FS)->retaddr_column = 16; \ - goto SUCCESS; \ - } while (0) -#else /* ifdef __x86_64__ */ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - \ - /* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ \ - if (*(unsigned short *)(pc_+0) == 0xb858 \ - && *(unsigned int *)(pc_+2) == 119 \ - && *(unsigned short *)(pc_+6) == 0x80cd) \ - sc_ = (CONTEXT)->cfa + 4; \ - /* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ \ - else if (*(unsigned char *)(pc_+0) == 0xb8 \ - && *(unsigned int *)(pc_+1) == 173 \ - && *(unsigned short *)(pc_+5) == 0x80cd) \ - { \ - struct rt_sigframe { \ - int sig; \ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ - struct ucontext uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->esp; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 4; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - /* The SVR4 register numbering macros aren't usable in libgcc. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \ - (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \ - (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \ - (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \ - (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \ - (FS)->regs.reg[7].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \ - (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \ - (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \ - (FS)->retaddr_column = 8; \ - goto SUCCESS; \ - } while (0) -#endif /* ifdef __x86_64__ */ -#endif /* ifdef inhibit_libc */ +#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h" |