diff options
author | Elliott Hughes <enh@google.com> | 2014-01-31 10:27:02 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-01-31 10:27:02 +0000 |
commit | c1c1c8272860225a066d4365e9ebe87a753405b3 (patch) | |
tree | 446d4ee3f9ddf648d6168dd18cb69d587de2fa99 | |
parent | c98690576ab6d7d13e5c0d3387db8149de71d9de (diff) | |
parent | 710f66342591c889b0bf545ff3c578731f112a6b (diff) | |
download | system_core-c1c1c8272860225a066d4365e9ebe87a753405b3.zip system_core-c1c1c8272860225a066d4365e9ebe87a753405b3.tar.gz system_core-c1c1c8272860225a066d4365e9ebe87a753405b3.tar.bz2 |
am 710f6634: Merge "Switch mips libcorkscrew over to <sys/ucontext.h>."
* commit '710f66342591c889b0bf545ff3c578731f112a6b':
Switch mips libcorkscrew over to <sys/ucontext.h>.
-rw-r--r-- | libcorkscrew/arch-mips/backtrace-mips.c | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/libcorkscrew/arch-mips/backtrace-mips.c b/libcorkscrew/arch-mips/backtrace-mips.c index 57cb324..832fb86 100644 --- a/libcorkscrew/arch-mips/backtrace-mips.c +++ b/libcorkscrew/arch-mips/backtrace-mips.c @@ -36,18 +36,7 @@ #include <sys/ptrace.h> #include <cutils/log.h> -#if defined(__BIONIC__) - -#if defined(__BIONIC_HAVE_UCONTEXT_T) - -// Bionic offers the Linux kernel headers. -#include <asm/sigcontext.h> -#include <asm/ucontext.h> -typedef struct ucontext ucontext_t; - -#else /* __BIONIC_HAVE_UCONTEXT_T */ - -/* Old versions of the Android <signal.h> didn't define ucontext_t. */ +#include <sys/ucontext.h> /* For PTRACE_GETREGS */ typedef struct { @@ -71,30 +60,6 @@ enum { REG_GP, REG_SP, REG_S8, REG_RA, }; -/* Machine context at the time a signal was raised. */ -typedef struct ucontext { - unsigned int sc_regmask; - unsigned int sc_status; - unsigned long long sc_pc; - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned int sc_acx; - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; - unsigned int sc_used_math; - unsigned int sc_dsp; - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - unsigned long sc_hi1; - unsigned long sc_lo1; - unsigned long sc_hi2; - unsigned long sc_lo2; - unsigned long sc_hi3; - unsigned long sc_lo3; -} ucontext_t; - -#endif /* __BIONIC_HAVE_UCONTEXT_T */ -#endif /* Unwind state. */ typedef struct { @@ -896,10 +861,10 @@ ssize_t unwind_backtrace_signal_arch(siginfo_t* siginfo __attribute__((unused)), const ucontext_t* uc = (const ucontext_t*)sigcontext; unwind_state_t state; - state.reg[DWARF_PC] = uc->sc_pc; - state.reg[DWARF_RA] = uc->sc_regs[REG_RA]; - state.reg[DWARF_FP] = uc->sc_regs[REG_S8]; - state.reg[DWARF_SP] = uc->sc_regs[REG_SP]; + state.reg[DWARF_PC] = uc->uc_mcontext.pc; + state.reg[DWARF_RA] = uc->uc_mcontext.gregs[REG_RA]; + state.reg[DWARF_FP] = uc->uc_mcontext.gregs[REG_S8]; + state.reg[DWARF_SP] = uc->uc_mcontext.gregs[REG_SP]; ALOGV("unwind_backtrace_signal_arch: " "ignore_depth=%d max_depth=%d pc=0x%08x sp=0x%08x ra=0x%08x\n", |