| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index 7abc24875e8326b68c05ac17eb201afa40e21d7f..b5b66b597e051bdfb7c5add28d10fca24af863b1 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -344,10 +344,12 @@ RawError* IsolateMessageHandler::HandleLibMessage(const Array& message) {
|
| Object& obj = Object::Handle(zone, message.At(2));
|
| if (!I->VerifyPauseCapability(obj)) return Error::null();
|
|
|
| +#if !defined(PRODUCT)
|
| // If we are already paused, don't pause again.
|
| if (FLAG_support_debugger && (I->debugger()->PauseEvent() == NULL)) {
|
| return I->debugger()->PauseInterrupted();
|
| }
|
| +#endif
|
| break;
|
| }
|
|
|
| @@ -662,6 +664,7 @@ MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
|
| } else {
|
| T->set_sticky_error(result);
|
| }
|
| +#if !defined(PRODUCT)
|
| // Notify the debugger about specific unhandled exceptions which are
|
| // withheld when being thrown. Do this after setting the sticky error
|
| // so the isolate has an error set when paused with the unhandled
|
| @@ -677,6 +680,7 @@ MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
|
| }
|
| }
|
| }
|
| +#endif // !defined(PRODUCT)
|
| return kError;
|
| }
|
| }
|
| @@ -755,7 +759,9 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
|
| environment_callback_(NULL),
|
| library_tag_handler_(NULL),
|
| api_state_(NULL),
|
| +#if !defined(PRODUCT)
|
| debugger_(NULL),
|
| +#endif
|
| resume_request_(false),
|
| last_resume_timestamp_(OS::GetCurrentTimeMillis()),
|
| random_(),
|
| @@ -920,10 +926,12 @@ Isolate* Isolate::Init(const char* name_prefix,
|
| result->set_terminate_capability(result->random()->NextUInt64());
|
|
|
| result->BuildName(name_prefix);
|
| +#if !defined(PRODUCT)
|
| if (FLAG_support_debugger) {
|
| result->debugger_ = new Debugger();
|
| result->debugger_->Initialize(result);
|
| }
|
| +#endif
|
| if (FLAG_trace_isolates) {
|
| if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) {
|
| OS::Print(
|
| @@ -981,10 +989,15 @@ int64_t Isolate::UptimeMicros() const {
|
| }
|
|
|
| bool Isolate::IsPaused() const {
|
| +#if defined(PRODUCT)
|
| + return false;
|
| +#else
|
| return (debugger_ != NULL) && (debugger_->PauseEvent() != NULL);
|
| +#endif
|
| }
|
|
|
| RawError* Isolate::PausePostRequest() {
|
| +#if !defined(PRODUCT)
|
| if (!FLAG_support_debugger) {
|
| return Error::null();
|
| }
|
| @@ -1001,6 +1014,7 @@ RawError* Isolate::PausePostRequest() {
|
| UNREACHABLE();
|
| }
|
| }
|
| +#endif
|
| return Error::null();
|
| }
|
|
|
| @@ -1384,9 +1398,11 @@ static MessageHandler::MessageStatus RunIsolate(uword parameter) {
|
| // way to debug. Set the breakpoint on the static function instead
|
| // of its implicit closure function because that latter is merely
|
| // a dispatcher that is marked as undebuggable.
|
| +#if !defined(PRODUCT)
|
| if (FLAG_support_debugger && FLAG_break_at_isolate_spawn) {
|
| isolate->debugger()->OneTimeBreakAtEntry(func);
|
| }
|
| +#endif
|
|
|
| func = func.ImplicitClosureFunction();
|
|
|
| @@ -1563,10 +1579,12 @@ void Isolate::LowLevelShutdown() {
|
| }
|
| }
|
|
|
| +#if !defined(PRODUCT)
|
| // Clean up debugger resources.
|
| if (FLAG_support_debugger) {
|
| debugger()->Shutdown();
|
| }
|
| +#endif
|
|
|
| // Close all the ports owned by this isolate.
|
| PortMap::ClosePorts(message_handler());
|
| @@ -1783,12 +1801,12 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
|
| // when at safepoint or the field_list_mutex_ lock has been taken.
|
| visitor->VisitPointer(reinterpret_cast<RawObject**>(&boxed_field_list_));
|
|
|
| +#if !defined(PRODUCT)
|
| // Visit objects in the debugger.
|
| if (FLAG_support_debugger) {
|
| debugger()->VisitObjectPointers(visitor);
|
| }
|
|
|
| -#if !defined(PRODUCT)
|
| // Visit objects that are being used for isolate reload.
|
| if (reload_context() != NULL) {
|
| reload_context()->VisitObjectPointers(visitor);
|
|
|