summaryrefslogtreecommitdiffstats
path: root/debuggerd/crasher.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-16 17:05:19 -0700
committerElliott Hughes <enh@google.com>2014-05-16 17:27:59 -0700
commit7e35ae8fc840cc1855d26084fdd72cbc3241f04d (patch)
tree734df3175f7c6a392792442065b91e74a2762688 /debuggerd/crasher.c
parentd20ba7fca295453648bc9093db03c16efbc6df1b (diff)
downloadsystem_core-7e35ae8fc840cc1855d26084fdd72cbc3241f04d.zip
system_core-7e35ae8fc840cc1855d26084fdd72cbc3241f04d.tar.gz
system_core-7e35ae8fc840cc1855d26084fdd72cbc3241f04d.tar.bz2
Add SIGTRAP support to crasher and debuggerd.
Bug: 15024256 Change-Id: I3f34993fcfd9799306852b0a2195db468370be6e
Diffstat (limited to 'debuggerd/crasher.c')
-rw-r--r--debuggerd/crasher.c4
1 files changed, 4 insertions, 0 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;