summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-16 21:12:17 -0700
committerElliott Hughes <enh@google.com>2014-05-16 21:12:17 -0700
commita323b504a70af5f143532f0ef521eb61ecddad6b (patch)
tree92cd44fe32508e1e4dde5242a454a9a500debe73
parent541859dbf710946f03999a962e85c4ca3d5c816a (diff)
downloadsystem_core-a323b504a70af5f143532f0ef521eb61ecddad6b.zip
system_core-a323b504a70af5f143532f0ef521eb61ecddad6b.tar.gz
system_core-a323b504a70af5f143532f0ef521eb61ecddad6b.tar.bz2
Teach debuggerd the name of SIGTRAP.
Also add SIGTRAP to the list of signals we don't want to double fault on. Bug: 15024256 Change-Id: I23ab80800563c007fcd3e42527329fedf762f0c8
-rw-r--r--debuggerd/debuggerd.cpp16
-rwxr-xr-xdebuggerd/tombstone.cpp9
2 files changed, 12 insertions, 13 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index 1298eda..3726c38 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -366,38 +366,36 @@ static void handle_request(int fd) {
}
static int do_server() {
- int s;
- struct sigaction act;
- int logsocket = -1;
-
- // debuggerd crashes can't be reported to debuggerd. Reset all of the
- // crash handlers.
- signal(SIGILL, SIG_DFL);
+ // debuggerd crashes can't be reported to debuggerd.
+ // Reset all of the crash handlers.
signal(SIGABRT, SIG_DFL);
signal(SIGBUS, SIG_DFL);
signal(SIGFPE, SIG_DFL);
+ signal(SIGILL, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
#ifdef SIGSTKFLT
signal(SIGSTKFLT, SIG_DFL);
#endif
+ signal(SIGTRAP, SIG_DFL);
// Ignore failed writes to closed sockets
signal(SIGPIPE, SIG_IGN);
- logsocket = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_DGRAM);
+ int logsocket = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_DGRAM);
if (logsocket < 0) {
logsocket = -1;
} else {
fcntl(logsocket, F_SETFD, FD_CLOEXEC);
}
+ struct sigaction act;
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask,SIGCHLD);
act.sa_flags = SA_NOCLDWAIT;
sigaction(SIGCHLD, &act, 0);
- s = socket_local_server(DEBUGGER_SOCKET_NAME, ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);
+ int s = socket_local_server(DEBUGGER_SOCKET_NAME, ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);
if (s < 0)
return 1;
fcntl(s, F_SETFD, FD_CLOEXEC);
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp
index 6d51171..1a00146 100755
--- a/debuggerd/tombstone.cpp
+++ b/debuggerd/tombstone.cpp
@@ -58,10 +58,10 @@
static bool signal_has_si_addr(int sig) {
switch (sig) {
- case SIGILL:
+ case SIGBUS:
case SIGFPE:
+ case SIGILL:
case SIGSEGV:
- case SIGBUS:
return true;
default:
return false;
@@ -70,16 +70,17 @@ static bool signal_has_si_addr(int sig) {
static const char* get_signame(int sig) {
switch(sig) {
- case SIGILL: return "SIGILL";
case SIGABRT: return "SIGABRT";
case SIGBUS: return "SIGBUS";
case SIGFPE: return "SIGFPE";
- case SIGSEGV: return "SIGSEGV";
+ case SIGILL: return "SIGILL";
case SIGPIPE: return "SIGPIPE";
+ case SIGSEGV: return "SIGSEGV";
#if defined(SIGSTKFLT)
case SIGSTKFLT: return "SIGSTKFLT";
#endif
case SIGSTOP: return "SIGSTOP";
+ case SIGTRAP: return "SIGTRAP";
default: return "?";
}
}