Skip to content

Commit e9f7361

Browse files
committed
Add SIGFPE to crasher.
Bug: 3399996 (cherry picked from commit 3ecc42106ea4cf825a57859cfd58442442685d24) Change-Id: I075613ca3c022ce8d38a06a5ba236ceff32d181c
1 parent 7e55d88 commit e9f7361

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

debuggerd/crasher.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,14 @@ static int do_action(const char* arg)
141141
} else if (!strcmp(arg, "assert")) {
142142
__assert("some_file.c", 123, "false");
143143
} else if (!strcmp(arg, "assert2")) {
144-
__assert2("some_file.c", 123, "some_function", "false");
144+
__assert2("some_file.c", 123, "some_function", "false");
145145
} else if (!strcmp(arg, "LOG_ALWAYS_FATAL")) {
146146
LOG_ALWAYS_FATAL("hello %s", "world");
147147
} else if (!strcmp(arg, "LOG_ALWAYS_FATAL_IF")) {
148148
LOG_ALWAYS_FATAL_IF(true, "hello %s", "world");
149+
} else if (!strcmp(arg, "SIGFPE")) {
150+
raise(SIGFPE);
151+
return EXIT_SUCCESS;
149152
} else if (!strcmp(arg, "SIGPIPE")) {
150153
int pipe_fds[2];
151154
pipe(pipe_fds);
@@ -177,6 +180,7 @@ static int do_action(const char* arg)
177180
fprintf(stderr, " assert2 call assert() with a function\n");
178181
fprintf(stderr, " LOG_ALWAYS_FATAL call LOG_ALWAYS_FATAL\n");
179182
fprintf(stderr, " LOG_ALWAYS_FATAL_IF call LOG_ALWAYS_FATAL\n");
183+
fprintf(stderr, " SIGFPE cause a SIGFPE\n");
180184
fprintf(stderr, " SIGPIPE cause a SIGPIPE\n");
181185
fprintf(stderr, " SIGSEGV cause a SIGSEGV at address 0x0 (synonym: crash)\n");
182186
fprintf(stderr, " SIGSEGV-non-null cause a SIGSEGV at a non-zero address\n");

0 commit comments

Comments
 (0)