From f47d0f6d5aa5878147dac31a86eabcc22f259da2 Mon Sep 17 00:00:00 2001 From: Itaru Kitayama Date: Fri, 16 Dec 2016 06:46:43 -0600 Subject: [PATCH] arm64 check return value of the ptrace systemcall, not errno --- proccontrol/src/linux.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proccontrol/src/linux.C b/proccontrol/src/linux.C index 7df4740164..438f5c8626 100644 --- a/proccontrol/src/linux.C +++ b/proccontrol/src/linux.C @@ -2414,7 +2414,11 @@ bool linux_thread::plat_getRegister(Dyninst::MachRegister reg, Dyninst::MachRegi result = do_ptrace((pt_req) PTRACE_PEEKUSER, lwp, (void *) (unsigned long) offset, NULL); #endif //unsigned long result = do_ptrace((pt_req) PTRACE_PEEKUSER, lwp, (void *) (unsigned long) offset, NULL); - if (errno != 0) { +#if defined(arch_aarch64) + if (ret != 0) { +#else + if (result != 0) { +#endif int error = errno; perr_printf("Error reading registers from %d: %s\n", lwp, strerror(errno)); //pthrd_printf("ARM-Info: offset(%d-%d)\n", (void *)(unsigned long)offset, offset/8);