summaryrefslogtreecommitdiff
path: root/debuggerd/crash_dump.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2020-03-30 21:40:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-30 21:40:58 +0000
commitcd63cae6b206a067fab1afe78f7647f1f2cb1513 (patch)
tree04e72546f2968a86b41a1151a5c8639adb2e852f /debuggerd/crash_dump.cpp
parent5677803cb7e78421f835513d088e24ccd6da6d87 (diff)
parentf03af8844acbd63f257c51577834d2c126a41f47 (diff)
Merge "Read fault address on arm64 using proposed kernel API."
Diffstat (limited to 'debuggerd/crash_dump.cpp')
-rw-r--r--debuggerd/crash_dump.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp
index 087ebaea8..0cd2350a8 100644
--- a/debuggerd/crash_dump.cpp
+++ b/debuggerd/crash_dump.cpp
@@ -295,6 +295,13 @@ static void ReadCrashInfo(unique_fd& fd, siginfo_t* siginfo,
case 3:
process_info->abort_msg_address = crash_info->data.s.abort_msg_address;
*siginfo = crash_info->data.s.siginfo;
+ if (signal_has_si_addr(siginfo)) {
+ // Make a copy of the ucontext field because otherwise it is not aligned enough (due to
+ // being in a packed struct) and clang complains about that.
+ ucontext_t ucontext = crash_info->data.s.ucontext;
+ process_info->has_fault_address = true;
+ process_info->fault_address = get_fault_address(siginfo, &ucontext);
+ }
regs->reset(unwindstack::Regs::CreateFromUcontext(unwindstack::Regs::CurrentArch(),
&crash_info->data.s.ucontext));
break;