diff options
| -rw-r--r-- | cmdline/cmdline.h | 2 | ||||
| -rw-r--r-- | cmdline/cmdline_parser_test.cc | 2 | ||||
| -rw-r--r-- | dex2oat/dex2oat.cc | 2 | ||||
| -rw-r--r-- | dexdump/dexdump_main.cc | 2 | ||||
| -rw-r--r-- | dexlayout/dexdiag.cc | 2 | ||||
| -rw-r--r-- | dexlayout/dexlayout_main.cc | 2 | ||||
| -rw-r--r-- | dexlist/dexlist.cc | 2 | ||||
| -rw-r--r-- | dexoptanalyzer/dexoptanalyzer.cc | 2 | ||||
| -rw-r--r-- | patchoat/patchoat.cc | 2 | ||||
| -rw-r--r-- | profman/profman.cc | 2 | ||||
| -rw-r--r-- | runtime/common_runtime_test.cc | 2 | ||||
| -rw-r--r-- | runtime/runtime.cc | 14 | ||||
| -rw-r--r-- | runtime/runtime.h | 3 |
13 files changed, 16 insertions, 23 deletions
diff --git a/cmdline/cmdline.h b/cmdline/cmdline.h index 98010d7089..18ca944383 100644 --- a/cmdline/cmdline.h +++ b/cmdline/cmdline.h @@ -295,7 +295,7 @@ struct CmdlineArgs { template <typename Args = CmdlineArgs> struct CmdlineMain { int Main(int argc, char** argv) { - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); std::unique_ptr<Args> args = std::unique_ptr<Args>(CreateArguments()); args_ = args.get(); diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index b224ec72de..d957869a76 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -123,7 +123,7 @@ class CmdlineParserTest : public ::testing::Test { using RuntimeParser = ParsedOptions::RuntimeParser; static void SetUpTestCase() { - art::InitLogging(nullptr, art::Runtime::Aborter); // argv = null + art::InitLogging(nullptr, art::Runtime::Abort); // argv = null } virtual void SetUp() { diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index c0ab21d4a0..92d60b252b 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -1133,7 +1133,7 @@ class Dex2Oat FINAL { original_argc = argc; original_argv = argv; - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); // Skip over argv[0]. argv++; diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc index 74cae3c961..606d4f81b1 100644 --- a/dexdump/dexdump_main.cc +++ b/dexdump/dexdump_main.cc @@ -60,7 +60,7 @@ static void usage(void) { */ int dexdumpDriver(int argc, char** argv) { // Art specific set up. - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); MemMap::Init(); // Reset options. diff --git a/dexlayout/dexdiag.cc b/dexlayout/dexdiag.cc index 78860e3f96..c14cd5f807 100644 --- a/dexlayout/dexdiag.cc +++ b/dexlayout/dexdiag.cc @@ -465,7 +465,7 @@ static int DexDiagMain(int argc, char* argv[]) { } // Art specific set up. - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); MemMap::Init(); #ifdef ART_TARGET_ANDROID diff --git a/dexlayout/dexlayout_main.cc b/dexlayout/dexlayout_main.cc index 3c627ea6f0..33d62decca 100644 --- a/dexlayout/dexlayout_main.cc +++ b/dexlayout/dexlayout_main.cc @@ -67,7 +67,7 @@ static void Usage(void) { */ int DexlayoutDriver(int argc, char** argv) { // Art specific set up. - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); MemMap::Init(); Options options; diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc index 29707af704..fa232a7634 100644 --- a/dexlist/dexlist.cc +++ b/dexlist/dexlist.cc @@ -211,7 +211,7 @@ static void usage(void) { */ int dexlistDriver(int argc, char** argv) { // Art specific set up. - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); MemMap::Init(); // Reset options. diff --git a/dexoptanalyzer/dexoptanalyzer.cc b/dexoptanalyzer/dexoptanalyzer.cc index 9a2eb7f8dd..e2c159aa5c 100644 --- a/dexoptanalyzer/dexoptanalyzer.cc +++ b/dexoptanalyzer/dexoptanalyzer.cc @@ -127,7 +127,7 @@ class DexoptAnalyzer FINAL { original_argc = argc; original_argv = argv; - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); // Skip over the command name. argv++; argc--; diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index 848eb8d329..149960ee2c 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -783,7 +783,7 @@ static int patchoat_image(TimingLogger& timings, } static int patchoat(int argc, char **argv) { - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); MemMap::Init(); const bool debug = kIsDebugBuild; orig_argc = argc; diff --git a/profman/profman.cc b/profman/profman.cc index f763b8ea05..e5e106b7b3 100644 --- a/profman/profman.cc +++ b/profman/profman.cc @@ -178,7 +178,7 @@ class ProfMan FINAL { original_argc = argc; original_argv = argv; - InitLogging(argv, Runtime::Aborter); + InitLogging(argv, Runtime::Abort); // Skip over the command name. argv++; diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc index 5beac1aa37..6441a44e6e 100644 --- a/runtime/common_runtime_test.cc +++ b/runtime/common_runtime_test.cc @@ -59,7 +59,7 @@ int main(int argc, char **argv) { // everything else. In case you want to see all messages, comment out the line. setenv("ANDROID_LOG_TAGS", "*:e", 1); - art::InitLogging(argv, art::Runtime::Aborter); + art::InitLogging(argv, art::Runtime::Abort); LOG(INFO) << "Running main() from common_runtime_test.cc..."; testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/runtime/runtime.cc b/runtime/runtime.cc index c11e4bd448..72dee77f9b 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -485,6 +485,10 @@ struct AbortState { void Runtime::Abort(const char* msg) { gAborting++; // set before taking any locks +#ifdef ART_TARGET_ANDROID + android_set_abort_message(msg); +#endif + // Ensure that we don't have multiple threads trying to abort at once, // which would result in significantly worse diagnostics. MutexLock mu(Thread::Current(), *Locks::abort_lock_); @@ -570,7 +574,7 @@ void Runtime::SweepSystemWeaks(IsMarkedVisitor* visitor) { bool Runtime::ParseOptions(const RuntimeOptions& raw_options, bool ignore_unrecognized, RuntimeArgumentMap* runtime_options) { - InitLogging(/* argv */ nullptr, Aborter); // Calls Locks::Init() as a side effect. + InitLogging(/* argv */ nullptr, Abort); // Calls Locks::Init() as a side effect. bool parsed = ParsedOptions::Parse(raw_options, ignore_unrecognized, runtime_options); if (!parsed) { LOG(ERROR) << "Failed to parse options"; @@ -2358,14 +2362,6 @@ void Runtime::RemoveSystemWeakHolder(gc::AbstractSystemWeakHolder* holder) { } } -NO_RETURN -void Runtime::Aborter(const char* abort_message) { -#ifdef ART_TARGET_ANDROID - android_set_abort_message(abort_message); -#endif - Runtime::Abort(abort_message); -} - RuntimeCallbacks* Runtime::GetRuntimeCallbacks() { return callbacks_.get(); } diff --git a/runtime/runtime.h b/runtime/runtime.h index 2505d8706e..af9d215454 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -649,9 +649,6 @@ class Runtime { return cha_; } - NO_RETURN - static void Aborter(const char* abort_message); - void AttachAgent(const std::string& agent_arg); const std::list<ti::Agent>& GetAgents() const { |