[Crash] Add lifecycle breadcrumbs for unattributable native crashes

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
This commit is contained in:
Lukas Brübach 2026-11-08 21:44:02 +00:00
parent 40ebd22549
commit 59db732abd
6 changed files with 61 additions and 0 deletions

View file

@ -418,6 +418,16 @@ TEST(CrashReporterTest, BeginSessionEndSessionRoundTripReportsClean)
reporter.endSession();
}
TEST(CrashReporterTest, AddBreadcrumbIsSafeWithoutInitAndWithNullArguments)
{
// Breadcrumbs are emitted from GUI slots and QtConcurrent workers regardless of whether
// the SDK was initialised (empty DSN, Never consent, OFF builds); none of these may crash.
CrashReporter::addBreadcrumb("card_db", "card database snapshot swapped in");
CrashReporter::addBreadcrumb(nullptr, "message");
CrashReporter::addBreadcrumb("category", nullptr);
SUCCEED();
}
} // namespace
int main(int argc, char **argv)