Skip to content

Commit

Permalink
feat(signal) signal code message update and add param for bsg_native_…
Browse files Browse the repository at this point in the history
…signal_code_names
  • Loading branch information
YYChen01988 committed Jan 29, 2025
1 parent 604d14f commit 21ac005
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 0 additions & 10 deletions bugsnag-plugin-android-ndk/src/main/jni/handlers/signal_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,8 @@ const char *bsg_get_signal_code_description(const int signal,
for (int i = 0; i < BSG_HANDLED_SIGNAL_COUNT; i++) {
if (bsg_native_signals[i] == signal) {
for (int j = 0; j < BSG_SIGNAL_CODE_COUNT; j++) {
printf("%s", "aaaaaaaaaaaaaaa,signal");
printf("%d", signal);
if (bsg_native_signal_codes[i][j] == signal_code) {
return bsg_native_signal_code_names[i][j];
printf("%s", "aaaaaaaaaaaaaaa,signal description");
printf("%s", bsg_native_signal_code_names[i][j]);
}
}
}
Expand Down Expand Up @@ -286,12 +282,6 @@ void bsg_handle_signal(int signum, siginfo_t *info,
bsg_get_signal_code_description(signal, signal_code);
if (error_message == NULL || *error_message == 0) {
error_message = (char *)bsg_native_signal_msgs[i];
printf("%s", "aaaaaaaaaaaaaaa, em is null or 0");

} else {
printf("%s", "aaaaaaaaaaaaaaa");
printf("%s", error_message);
printf("%d", signal_code);
}
bsg_strncpy(bsg_global_env->next_event.error.errorMessage, error_message,
sizeof(bsg_global_env->next_event.error.errorMessage));
Expand Down
6 changes: 5 additions & 1 deletion features/full_tests/native_crash_handling.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ Feature: Native crash reporting
| SIGILL |
| SIGTRAP |
And the exception "message" equals one of:
| Illegal instruction |
| Trace/breakpoint trap |
| Illegal instruction, code 4 (ILLTRP) |
| Trace/breakpoint trap, code 1 (BRKPT) |
| Trace/breakpoint trap, code 1 (BRKPT) |
And the exception "type" equals "c"
And the event "severity" equals "error"
And the event "unhandled" is true
Expand Down Expand Up @@ -132,6 +134,8 @@ Feature: Native crash reporting
| SIGILL |
| SIGTRAP |
And the exception "message" equals one of:
| Illegal instruction |
| Trace/breakpoint trap |
| Illegal instruction, code 4 (ILLTRP) |
| Trace/breakpoint trap, code 1 (BRKPT) |
And the exception "type" equals "c"
Expand Down
12 changes: 9 additions & 3 deletions features/full_tests/native_signal_raise.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Feature: Raising native signals
And the error payload contains a completed unhandled native report
And the exception "errorClass" equals "SIGILL"
And the exception "message" equals one of:
| Illegal instruction, code 4 (ILLTRP) |
| Illegal instruction |
| Trace/breakpoint trap |
| Illegal instruction, code 4 (ILLTRP) |
| Trace/breakpoint trap, code 5 (TRAP_UNK) |
And the exception "type" equals "c"
And the event "severity" equals "error"
Expand Down Expand Up @@ -55,7 +57,9 @@ Feature: Raising native signals
And I wait to receive an error
And the error payload contains a completed unhandled native report
And the exception "errorClass" equals "SIGFPE"
And the exception "message" equals "Floating-point exception, code 8 (FLTSUB)"
And the exception "message" equals one of:
| Floating-point exception |
| Floating-point exception, code 8 (FLTSUB) |
And the exception "type" equals "c"
And the event "severity" equals "error"
And the event "unhandled" is true
Expand All @@ -66,7 +70,9 @@ Feature: Raising native signals
And I wait to receive an error
And the error payload contains a completed unhandled native report
And the exception "errorClass" equals "SIGTRAP"
And the exception "message" equals "Trace/breakpoint trap, code 5 (TRAP_UNK)"
And the exception "message" equals one of:
| Trace/breakpoint trap |
| Trace/breakpoint trap, code 5 (TRAP_UNK) |
And the exception "type" equals "c"
And the event "severity" equals "error"
And the event "unhandled" is true

0 comments on commit 21ac005

Please sign in to comment.