diff options
author | Christopher Ferris <cferris@google.com> | 2020-09-23 15:51:46 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2020-09-24 18:46:23 -0700 |
commit | b05c472421d9d4dd919926c95a5c1de4eb9a721a (patch) | |
tree | c8b6009b561bc70170f102a9697ccf42bb997999 /debuggerd/handler/debuggerd_fallback.cpp | |
parent | de540ad2f1db55eb34adc8af8f5074163ffb9118 (diff) |
Add arch member into Unwinder object.
This simplifies some of the logic and removes the need to pass an
Arch value to functions that should already know about the arch
it is operating on.
Includes fixes for debuggerd/libbacktrace.
Added new unit tests to cover new cases.
Test: All unit tests pass.
Test: Faked unwinder failing to verify debuggerd error messages display
Test: properly in backtrace and tombstone.
Change-Id: I439fcae0695befcfb1cb4c0a786cc74949d33425
Diffstat (limited to 'debuggerd/handler/debuggerd_fallback.cpp')
-rw-r--r-- | debuggerd/handler/debuggerd_fallback.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/debuggerd/handler/debuggerd_fallback.cpp b/debuggerd/handler/debuggerd_fallback.cpp index 9bcbdb36a..abcb2c4ed 100644 --- a/debuggerd/handler/debuggerd_fallback.cpp +++ b/debuggerd/handler/debuggerd_fallback.cpp @@ -82,16 +82,12 @@ static void debuggerd_fallback_trace(int output_fd, ucontext_t* ucontext) { thread.pid = getpid(); thread.tid = gettid(); thread.thread_name = get_thread_name(gettid()); - unwindstack::ArchEnum arch = unwindstack::Regs::CurrentArch(); - thread.registers.reset(unwindstack::Regs::CreateFromUcontext(arch, ucontext)); + thread.registers.reset( + unwindstack::Regs::CreateFromUcontext(unwindstack::Regs::CurrentArch(), ucontext)); // TODO: Create this once and store it in a global? unwindstack::UnwinderFromPid unwinder(kMaxFrames, getpid()); - if (unwinder.Init(arch)) { - dump_backtrace_thread(output_fd, &unwinder, thread); - } else { - async_safe_format_log(ANDROID_LOG_ERROR, "libc", "Unable to init unwinder."); - } + dump_backtrace_thread(output_fd, &unwinder, thread); } __linker_disable_fallback_allocator(); } |