Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: vm/debugger.cc

Issue 11052006: 1. Create a port when a debugger object is created for an isolate, use this (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/debugger.h ('k') | vm/debugger_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/debugger.cc
===================================================================
--- vm/debugger.cc (revision 13206)
+++ vm/debugger.cc (working copy)
@@ -4,6 +4,8 @@
#include "vm/debugger.h"
+#include "include/dart_api.h"
+
#include "vm/code_generator.h"
#include "vm/code_patcher.h"
#include "vm/compiler.h"
@@ -14,6 +16,7 @@
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/os.h"
+#include "vm/port.h"
#include "vm/stack_frame.h"
#include "vm/stub_code.h"
#include "vm/symbols.h"
@@ -159,9 +162,12 @@
void Debugger::SignalIsolateEvent(EventType type) {
if (event_handler_ != NULL) {
+ Debugger* debugger = Isolate::Current()->debugger();
+ ASSERT(debugger != NULL);
DebuggerEvent event;
event.type = type;
- event.isolate = Isolate::Current();
+ event.isolate_id = debugger->GetIsolateId();
+ ASSERT(event.isolate_id != ILLEGAL_ISOLATE_ID);
(*event_handler_)(&event);
}
}
@@ -631,6 +637,7 @@
Debugger::Debugger()
: isolate_(NULL),
+ isolate_id_(ILLEGAL_ISOLATE_ID),
initialized_(false),
next_id_(1),
stack_trace_(NULL),
@@ -645,6 +652,8 @@
Debugger::~Debugger() {
+ PortMap::ClosePort(isolate_id_);
+ isolate_id_ = ILLEGAL_ISOLATE_ID;
ASSERT(src_breakpoints_ == NULL);
ASSERT(code_breakpoints_ == NULL);
ASSERT(stack_trace_ == NULL);
@@ -664,6 +673,8 @@
bpt->Disable();
delete bpt;
}
+ // Signal isolate shutdown event.
+ SignalIsolateEvent(Debugger::kIsolateShutdown);
}
@@ -1416,7 +1427,15 @@
return;
}
isolate_ = isolate;
+ // Create a port here, we don't expect to receive any messages on this port.
+ // This port will be used as a unique ID to represet the isolate in the
+ // debugger wire protocol messages.
+ // NOTE: SetLive is never called on this port.
+ isolate_id_ = PortMap::CreatePort(isolate->message_handler());
initialized_ = true;
+
+ // Signal isolate creation event.
+ SignalIsolateEvent(Debugger::kIsolateCreated);
}
« no previous file with comments | « vm/debugger.h ('k') | vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698