diff options
author | 2018-12-07 17:37:35 +0000 | |
---|---|---|
committer | 2018-12-07 17:37:35 +0000 | |
commit | 573b3877fac3c5a4a9703301502694fe7219b21c (patch) | |
tree | 4c921582be3fb3bdd83af5b62c482fc066ea5638 | |
parent | 1e2e714cf25f37e5e925477cdd68fe2baf82c134 (diff) | |
parent | 89036a3a16a59708d4f59d63fa923ddc6c029eb8 (diff) |
Merge "ART: Set Runtime fault message on abort"
-rw-r--r-- | runtime/runtime.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 8e3d71a79e..182319a27c 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -548,18 +548,18 @@ struct AbortState { void Runtime::Abort(const char* msg) { auto old_value = gAborting.fetch_add(1); // set before taking any locks -#ifdef ART_TARGET_ANDROID + // Only set the first abort message. if (old_value == 0) { - // Only set the first abort message. +#ifdef ART_TARGET_ANDROID android_set_abort_message(msg); - } #else - UNUSED(old_value); -#endif - -#ifdef ART_TARGET_ANDROID - android_set_abort_message(msg); + // Set the runtime fault message in case our unexpected-signal code will run. + Runtime* current = Runtime::Current(); + if (current != nullptr) { + current->SetFaultMessage(msg); + } #endif + } // Ensure that we don't have multiple threads trying to abort at once, // which would result in significantly worse diagnostics. |