summaryrefslogtreecommitdiff
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 774a3cf4ce..6194b816d6 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -292,7 +292,7 @@ Runtime::Runtime()
is_native_debuggable_(false),
async_exceptions_thrown_(false),
non_standard_exits_enabled_(false),
- is_java_debuggable_(false),
+ runtime_debug_state_(RuntimeDebugState::kNonJavaDebuggable),
monitor_timeout_enable_(false),
monitor_timeout_ns_(0),
zygote_max_failed_boots_(0),
@@ -1528,7 +1528,7 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) {
compiler_options_ = runtime_options.ReleaseOrDefault(Opt::CompilerOptions);
for (const std::string& option : Runtime::Current()->GetCompilerOptions()) {
if (option == "--debuggable") {
- SetJavaDebuggable(true);
+ SetRuntimeDebugState(RuntimeDebugState::kJavaDebuggableAtInit);
break;
}
}
@@ -3209,9 +3209,14 @@ class UpdateEntryPointsClassVisitor : public ClassVisitor {
instrumentation::Instrumentation* const instrumentation_;
};
-void Runtime::SetJavaDebuggable(bool value) {
- is_java_debuggable_ = value;
- // Do not call DeoptimizeBootImage just yet, the runtime may still be starting up.
+void Runtime::SetRuntimeDebugState(RuntimeDebugState state) {
+ if (state == RuntimeDebugState::kJavaDebuggableAtInit) {
+ DCHECK(!IsStarted());
+ } else {
+ // We never change the state if we started as a debuggable runtime.
+ DCHECK(runtime_debug_state_ != RuntimeDebugState::kJavaDebuggableAtInit);
+ }
+ runtime_debug_state_ = state;
}
void Runtime::DeoptimizeBootImage() {