summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-04-25 16:05:34 -0700
committerElliott Hughes <enh@google.com>2014-04-25 20:20:39 -0700
commit855fcc3114c20ff9fd286fe1723d1413fec9685a (patch)
tree012f6de674c3ba210b9f1de42d9c7607a6e9862d /debuggerd/debuggerd.cpp
parent2317287d18fae3f9ae0f3beb7748a804f06b5720 (diff)
downloadsystem_core-855fcc3114c20ff9fd286fe1723d1413fec9685a.zip
system_core-855fcc3114c20ff9fd286fe1723d1413fec9685a.tar.gz
system_core-855fcc3114c20ff9fd286fe1723d1413fec9685a.tar.bz2
Use the si_code value bionic passes us.
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
Diffstat (limited to 'debuggerd/debuggerd.cpp')
-rw-r--r--debuggerd/debuggerd.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index a2b164e..76bd7a3 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -51,6 +51,7 @@ struct debugger_request_t {
pid_t pid, tid;
uid_t uid, gid;
uintptr_t abort_msg_address;
+ int32_t original_si_code;
};
static int write_string(const char* file, const char* string) {
@@ -218,6 +219,7 @@ static int read_request(int fd, debugger_request_t* out_request) {
out_request->uid = cr.uid;
out_request->gid = cr.gid;
out_request->abort_msg_address = msg.abort_msg_address;
+ out_request->original_si_code = msg.original_si_code;
if (msg.action == DEBUGGER_ACTION_CRASH) {
// Ensure that the tid reported by the crashing process is valid.
@@ -302,9 +304,10 @@ static void handle_request(int fd) {
case SIGSTOP:
if (request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) {
XLOG("stopped -- dumping to tombstone\n");
- tombstone_path = engrave_tombstone(
- request.pid, request.tid, signal, request.abort_msg_address, true, true,
- &detach_failed, &total_sleep_time_usec);
+ tombstone_path = engrave_tombstone(request.pid, request.tid,
+ signal, request.original_si_code,
+ request.abort_msg_address, true, true,
+ &detach_failed, &total_sleep_time_usec);
} else if (request.action == DEBUGGER_ACTION_DUMP_BACKTRACE) {
XLOG("stopped -- dumping to fd\n");
dump_backtrace(fd, -1, request.pid, request.tid, &detach_failed,
@@ -336,9 +339,10 @@ static void handle_request(int fd) {
kill(request.pid, SIGSTOP);
// don't dump sibling threads when attaching to GDB because it
// makes the process less reliable, apparently...
- tombstone_path = engrave_tombstone(
- request.pid, request.tid, signal, request.abort_msg_address, !attach_gdb,
- false, &detach_failed, &total_sleep_time_usec);
+ tombstone_path = engrave_tombstone(request.pid, request.tid,
+ signal, request.original_si_code,
+ request.abort_msg_address, !attach_gdb, false,
+ &detach_failed, &total_sleep_time_usec);
break;
default: