libunwind and Androids debuggerd

The Android dynamic linker provides its own _start routine that registers a signal handler on SIGSEGV and the like. Whenever a dynamically linked executable crashes the signal handler gets invoked and transmits the thread id of the crashing process to the debuggerd via a local socket (see: bionic/linker/debugger.c). The debuggerd uses ptrace to get the register contents of the crashing process and to display the call chain (see: system/core/debuggerd/debuggerd.c). In order to demonstrate the remote backtracing capabilities of libunwind I've ported the library to Android and changed the debuggerd to make use of libunwind-ptrace to display the stack trace.

Where to find it


The following was tested:

Future Work

  • improve debuggerd to display more than just a backtrace
  • implement handling of FP registers on ARM
  • correct handling of the thumb marker
  • support for architectures other than ARM

The blueprints are here:

The work was done by:

Work was completed in September 2011.


WorkingGroups/ToolChain/Outputs/LibunwindDebuggerd (last modified 2012-10-18 12:26:30)