Skip to content

Commit a8ea230

Browse files
committed
update tombstone message construction
1 parent 7db5895 commit a8ea230

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,24 @@ private Message constructMessage(@NonNull final TombstoneProtos.Tombstone tombst
165165
final TombstoneProtos.Signal signalInfo = tombstone.getSignalInfo();
166166

167167
// reproduce the message `debuggerd` would use to dump the stack trace in logcat
168-
message.setFormatted(
169-
String.format(
170-
Locale.ROOT,
171-
"Fatal signal %s (%d), %s (%d), pid = %d (%s)",
172-
signalInfo.getName(),
173-
signalInfo.getNumber(),
174-
signalInfo.getCodeName(),
175-
signalInfo.getCode(),
176-
tombstone.getPid(),
177-
String.join(" ", tombstone.getCommandLineList())));
168+
String command = String.join(" ", tombstone.getCommandLineList());
169+
if (tombstone.hasSignalInfo()) {
170+
String abortMessage = tombstone.getAbortMessage();
171+
message.setFormatted(
172+
String.format(
173+
Locale.ROOT,
174+
"%sFatal signal %s (%d), %s (%d), pid = %d (%s)",
175+
abortMessage != null ? abortMessage + ": " : "",
176+
signalInfo.getName(),
177+
signalInfo.getNumber(),
178+
signalInfo.getCodeName(),
179+
signalInfo.getCode(),
180+
tombstone.getPid(),
181+
command));
182+
} else {
183+
message.setFormatted(
184+
String.format(Locale.ROOT, "Fatal exit pid = %d (%s)", tombstone.getPid(), command));
185+
}
178186

179187
return message;
180188
}

0 commit comments

Comments
 (0)