From 2d286b31193e527e3d7fd316181827b66597be01 Mon Sep 17 00:00:00 2001 From: peadar Date: Sat, 26 Aug 2023 10:49:13 -0700 Subject: [PATCH] fix aarch 64 --- process.cc | 4 ++-- tests/badfp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/process.cc b/process.cc index 8436e79..b97fc6d 100644 --- a/process.cc +++ b/process.cc @@ -948,12 +948,12 @@ ThreadStack::unwind(Process &p, Elf::CoreRegisters ®s, unsigned maxFrames) Dwarf::ProcessLocation badip = { p, IP(prev.regs) }; if (!badip.valid() || (badip.codeloc->phdr_->p_flags & PF_X) == 0) { + auto newRegs = prev.regs; // start with a copy of prev frames regs. #if defined(__amd64__) || defined(__i386__) // get stack pointer in the current frame, and read content of TOS auto sp = SP(prev.regs); Elf::Addr ip; auto in = p.io->read(sp, sizeof ip, (char *)&ip); - auto newRegs = prev.regs; // start with a copy of prev frames regs. if (in == sizeof ip) { SP(newRegs) = sp + sizeof ip; IP(newRegs) = ip; // .. insn pointer. @@ -980,7 +980,7 @@ ThreadStack::unwind(Process &p, Elf::CoreRegisters ®s, unsigned maxFrames) ucontext_t uc; }; auto sigframe = p.io->readObj(prev.regs.sp); - Elf::CoreRegs newRegs; + Elf::CoreRegisters newRegs; for (int i = 0; i < 31; ++i) newRegs.regs[i] = sigframe.uc.uc_mcontext.regs[i]; newRegs.sp = sigframe.uc.uc_mcontext.sp; diff --git a/tests/badfp.c b/tests/badfp.c index 8d70ebc..ceca699 100644 --- a/tests/badfp.c +++ b/tests/badfp.c @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) { int c; - void *addr; + void *addr = 0; while ((c = getopt(argc, argv, "dh")) != -1) { switch (c) { case 'h': // handle the fault with a signal handler.