am c4afc192: Merge "Add SIGTRAP support to crasher and debuggerd."

* commit 'c4afc19236ae7253acc3266b4ca8515473e9c7cc':
  Add SIGTRAP support to crasher and debuggerd.
This commit is contained in:
Elliott Hughes 2014-05-17 00:42:36 +00:00 committed by Android Git Automerger
commit 5e74210732
2 changed files with 7 additions and 2 deletions

View file

@ -144,6 +144,9 @@ static int do_action(const char* arg)
close(pipe_fds[0]); close(pipe_fds[0]);
write(pipe_fds[1], "oops", 4); write(pipe_fds[1], "oops", 4);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else if (!strcmp(arg, "SIGTRAP")) {
raise(SIGTRAP);
return EXIT_SUCCESS;
} else if (!strcmp(arg, "heap-usage")) { } else if (!strcmp(arg, "heap-usage")) {
abuse_heap(); 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, " LOG_ALWAYS_FATAL_IF call LOG_ALWAYS_FATAL\n");
fprintf(stderr, " SIGPIPE cause a SIGPIPE\n"); fprintf(stderr, " SIGPIPE cause a SIGPIPE\n");
fprintf(stderr, " SIGSEGV cause a SIGSEGV (synonym: crash)\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, "prefix any of the above with 'thread-' to not run\n");
fprintf(stderr, "on the process' main thread.\n"); fprintf(stderr, "on the process' main thread.\n");
return EXIT_SUCCESS; return EXIT_SUCCESS;

View file

@ -322,15 +322,16 @@ static void handle_request(int fd) {
} }
break; break;
case SIGILL:
case SIGABRT: case SIGABRT:
case SIGBUS: case SIGBUS:
case SIGFPE: case SIGFPE:
case SIGSEGV: case SIGILL:
case SIGPIPE: case SIGPIPE:
case SIGSEGV:
#ifdef SIGSTKFLT #ifdef SIGSTKFLT
case SIGSTKFLT: case SIGSTKFLT:
#endif #endif
case SIGTRAP:
XLOG("stopped -- fatal signal\n"); XLOG("stopped -- fatal signal\n");
// Send a SIGSTOP to the process to make all of // Send a SIGSTOP to the process to make all of
// the non-signaled threads stop moving. Without // the non-signaled threads stop moving. Without