summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move 32 bit/64 bit check into debuggerd.Christopher Ferris2015-01-201-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix debuggerd issues.Christopher Ferris2014-11-031-23/+19
| | | | | | | | | | | | | | - Fix a problem where a tid exits before the attach completes, and it causes debuggerd to self terminate. - Fix a problem where sibling tid dumps do not properly wait for the tid to get signalled. Bug: 17800180 Bug: 12567315 (cherry picked from commit 84ddb34a3af77dbe490aaa07b738bbfd7109d5ba) Change-Id: I45e33865614d4c96f4a89cf117398666b556d500
* Add SELinux MAC to debuggerd.Stephen Smalley2014-07-241-0/+56
| | | | | | | | | | | | | debuggerd allows uid-0 processes to dump tombstones or backtraces of any process, and uid-system processes to dump backtraces of any processes. Restrict these operations via SELinux based on the client context, the target process context, and the action. Depends on I8e120d319512ff207ed22ed87cde4e0432a13dda for the corresponding policy definitions. Change-Id: Ib317564e54e07cc21f259e75124b762ad17c6e16 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* Fixed tid/pid mixup in debuggerd gdbclient output.Brigid Smith2014-06-271-5/+5
| | | | | | | Now the debugging output shows the tid of the crashed thread instead of the pid of the process that crashed. Change-Id: I637f409ff02d73d458edc6d1a5c462c21d128211
* Fixed pathname for connecting to debugger.Brigid Smith2014-06-241-11/+1
| | | | | | | The debug output was still showing the pathname that worked with gdbclient before my changes, and therefore did not work after the fact. Change-Id: Ie12d79f5346088914ce0a70bda69780707b31d31
* Fix debuggerd "format '%p'" build breakage.Elliott Hughes2014-06-191-3/+1
| | | | Change-Id: I589d44485e55c23d1f1a6edfa8310a90cac2429e
* Removed log.quiet and log = NULL cases from debuggerd.Brigid Smith2014-06-191-42/+40
| | | | | | | | | Now the functionality implemented by these semi-confusing cases has been replaced with the same logtype enum behavior that is easier to understand, and cases that used log-looking behavior to print to logcat (when log = NULL) now use the more transparent ALOGE/ALOGD functions. Change-Id: I7e38f2d4ca74a828df4d2266b3ea34edd3c6f5bb
* Changing how debuggerd filters log messages to different locations.Brigid Smith2014-06-161-18/+17
| | | | | | | | | | | | | The system by which debuggerd filters its output to different locations is now based on an enum called logtype with easy to understand categories for log messages (like THREAD, MEMORY, etc.) instead of the old, fairly esoteric scope_flags variable. Now much of the output that previously went to logcat does not show up on the screen, but all output can be found in the tombstone file. In addition, the tombstone's location is now printed so it can be located easily. Bug: 15341747 Change-Id: Ia2f2051d1dfdea934d0e6ed220f24345e35ba6a2
* Teach debuggerd the name of SIGTRAP.Elliott Hughes2014-05-161-9/+7
| | | | | | | Also add SIGTRAP to the list of signals we don't want to double fault on. Bug: 15024256 Change-Id: I23ab80800563c007fcd3e42527329fedf762f0c8
* Remove the broken LED flashing code from debuggerd.Elliott Hughes2014-05-161-63/+2
| | | | Change-Id: I4d0cbe14daa90ac5f91ce4597584448ee3c65dda
* Output correct gdbserver instructions from debuggerd.Elliott Hughes2014-05-161-14/+34
| | | | | Bug: 15021938 Change-Id: I2df433d939f5f83ed2a2a30af357b83e4d8e5331
* Add SIGTRAP support to crasher and debuggerd.Elliott Hughes2014-05-161-2/+3
| | | | | Bug: 15024256 Change-Id: I3f34993fcfd9799306852b0a2195db468370be6e
* Use the si_code value bionic passes us.Elliott Hughes2014-04-251-6/+10
| | | | | | | | | Bionic needs to re-raise various signals, which means the si_code debuggerd sees has been clobbered. If bionic sends us the original si_code value, we can use that instead of the one we see when the ptrace the crashed process' siginfo. Change-Id: If116a6bc667d55a6fb39b74f96673292af4e4c8c
* Use socklen_t instead of int in debuggerd.Elliott Hughes2014-02-071-11/+9
| | | | | | Also other trivial C++ cleanup. Change-Id: I9b5278c5205e0ea4f9dcbbe3e7b99921dd2436dc
* AArch64: Port debuggerdKévin PETIT2014-01-301-1/+2
| | | | | Change-Id: Ib18f76f375a1d70c84e0a09d221e17ac43144b96 Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* Next phase of the move, reformat use C++ features.Christopher Ferris2014-01-131-447/+422
| | | | | | | | | | | | | | | | | Use the libbacktrace C++ interface instead of the C interface in debuggerd. Reformat the debuggerd code to be closer to Google C++ style. Fix all debuggerd casts to be C++ casts. Add a frame number to the frame data structure for ease of formatting and add another FormatFrameData function. Change the format_test to use the new FormatFrameData function. Modify all of the backtrace_test to use the C++ interface. Change-Id: I10e1610861acf7f4a3ad53276b74971cfbfda464
* Move to C++ for debuggerd.Christopher Ferris2014-01-101-0/+539
This is part 1, only including the bare minimum changes because our diff tool doesn't easily show differences when a file moves. This also breaks it into a small chunk in case some other changes break things, as unlikely as I think that will be. Change-Id: Ib7a3e7a2cc1ac574d15b65fda23813ebcf5d31af