Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libs/utils/src/Panic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#include <new>
#include <string_view>
#include <utility>
#if defined(__ANDROID__)
# include <android/set_abort_message.h>
#endif

namespace utils {

Expand Down Expand Up @@ -222,6 +225,13 @@ void TPanic<T>::panic(char const* function, char const* file, int line, char con
// Call the user provided handler
UserPanicHandler::get().call(e);

// Register the full panic message as the tombstone "Abort message:" so that it
// appears in crash reports collected by Google Play Console and other tools that
// read tombstones from field devices (which never have access to logcat output).
#if defined(__ANDROID__)
android_set_abort_message(e.what());
#endif

Comment on lines +228 to +234
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be moved just above the std::abort() call, and after the throw e (if exceptions are enabled, we might not abort).

// if exceptions are enabled, throw now.
#ifdef __EXCEPTIONS
throw e;
Expand Down
Loading