platform_system_core/debuggerd
Christopher Ferris 9774df6134 Move 32 bit/64 bit check into debuggerd.
On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone
try and directly contact the correct debuggerd (32 bit vs 64 bit)
by reading the elf information for the executable.
Unfortunately, system_server makes a call to dump_backtrace_to_file
and it doesn't have permissions to read the executable data, so it
defaults to always contacting the 64 bit debuggerd.
This CL changes the code so that all dump requests go to the 64 bit
debuggerd, which reads the elf information and redirects requests for
32 bit processes to the 32 bit debuggerd.

Testing:

- Forced the watchdog code in system_server to dump stacks and
  verified that all native stacks are dumped correctly.
- Verified that dumpstate and bugreport still properly dump the native
  processes on a 64 bit and 32 bit system.
- Intentionally forced the 64 bit to 32 bit redirect to write only a
  byte at a time and verified there are no errors, and no dropped data.
- Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes
  seemlessly.
- Used debuggerd on a 32 bit system to dump native stacks.

Bug: https://code.google.com/p/android/issues/detail?id=97024
Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
2015-01-20 17:22:07 -08:00
..
arm Add missing arm64 registers. 2014-07-14 18:56:53 -07:00
arm64 Add missing arm64 registers. 2014-07-14 18:56:53 -07:00
mips Updated non-ARM archs to reflect logging changes. 2014-06-19 11:33:38 -07:00
x86 Updated non-ARM archs to reflect logging changes. 2014-06-19 11:33:38 -07:00
x86_64 Updated non-ARM archs to reflect logging changes. 2014-06-19 11:33:38 -07:00
Android.mk Move 32 bit/64 bit check into debuggerd. 2015-01-20 17:22:07 -08:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
NOTICE auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
backtrace.cpp am a11ac455: Merge "Fix debuggerd issues." 2014-11-03 20:23:55 +00:00
backtrace.h Changing how debuggerd filters log messages to different locations. 2014-06-16 14:41:21 -07:00
crasher.c Make crasher smash-stack work. 2014-12-11 17:49:12 -08:00
debuggerd.cpp Move 32 bit/64 bit check into debuggerd. 2015-01-20 17:22:07 -08:00
getevent.cpp Next phase of the move, reformat use C++ features. 2014-01-13 14:21:52 -08:00
getevent.h Use libcorkscrew in debuggerd. 2011-10-22 16:43:00 -07:00
machine.h Changing how debuggerd filters log messages to different locations. 2014-06-16 14:41:21 -07:00
tombstone.cpp #include <arpa/inet.h> for htonl. 2014-12-18 23:49:17 +00:00
tombstone.h Removed log.quiet and log = NULL cases from debuggerd. 2014-06-19 10:59:01 -07:00
utility.cpp Print ASCII near register for all archs 2014-12-10 10:21:12 -08:00
utility.h Fix debuggerd issues. 2014-11-03 11:26:33 -08:00