summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-17 00:39:21 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-17 00:39:22 +0000
commitc4afc19236ae7253acc3266b4ca8515473e9c7cc (patch)
treeb3317e7f3f987c248452ece82145b1899840185a
parent2d03a498f9a1258740a9bbf6b28882506cde3ad9 (diff)
parent7e35ae8fc840cc1855d26084fdd72cbc3241f04d (diff)
downloadsystem_core-c4afc19236ae7253acc3266b4ca8515473e9c7cc.zip
system_core-c4afc19236ae7253acc3266b4ca8515473e9c7cc.tar.gz
system_core-c4afc19236ae7253acc3266b4ca8515473e9c7cc.tar.bz2
Merge "Add SIGTRAP support to crasher and debuggerd."
-rw-r--r--debuggerd/crasher.c4
-rw-r--r--debuggerd/debuggerd.cpp5
2 files changed, 7 insertions, 2 deletions
diff --git a/debuggerd/crasher.c b/debuggerd/crasher.c
index 01ce0be..4721da9 100644
--- a/debuggerd/crasher.c
+++ b/debuggerd/crasher.c
@@ -144,6 +144,9 @@ static int do_action(const char* arg)
close(pipe_fds[0]);
write(pipe_fds[1], "oops", 4);
return EXIT_SUCCESS;
+ } else if (!strcmp(arg, "SIGTRAP")) {
+ raise(SIGTRAP);
+ return EXIT_SUCCESS;
} else if (!strcmp(arg, "heap-usage")) {
abuse_heap();
}
@@ -164,6 +167,7 @@ static int do_action(const char* arg)
fprintf(stderr, " LOG_ALWAYS_FATAL_IF call LOG_ALWAYS_FATAL\n");
fprintf(stderr, " SIGPIPE cause a SIGPIPE\n");
fprintf(stderr, " SIGSEGV cause a SIGSEGV (synonym: crash)\n");
+ fprintf(stderr, " SIGTRAP cause a SIGTRAP\n");
fprintf(stderr, "prefix any of the above with 'thread-' to not run\n");
fprintf(stderr, "on the process' main thread.\n");
return EXIT_SUCCESS;
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index 76bd7a3..94232cf 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -322,15 +322,16 @@ static void handle_request(int fd) {
}
break;
- case SIGILL:
case SIGABRT:
case SIGBUS:
case SIGFPE:
- case SIGSEGV:
+ case SIGILL:
case SIGPIPE:
+ case SIGSEGV:
#ifdef SIGSTKFLT
case SIGSTKFLT:
#endif
+ case SIGTRAP:
XLOG("stopped -- fatal signal\n");
// Send a SIGSTOP to the process to make all of
// the non-signaled threads stop moving. Without