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

Unified Diff: vm/debugger.cc

Issue 11026011: Add isolate event handler setup in order to be able to propagate isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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
« vm/debugger.h ('K') | « 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 13083)
+++ vm/debugger.cc (working copy)
@@ -24,6 +24,30 @@
DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages");
+
+static void DefaultBreakpointHandler(SourceBreakpoint* bpt,
+ DebuggerStackTrace* stack) {
+ String& var_name = String::Handle();
+ Instance& value = Instance::Handle();
+ for (intptr_t i = 0; i < stack->Length(); i++) {
+ ActivationFrame* frame = stack->ActivationFrameAt(i);
+ OS::Print(" %"Pd". %s\n",
+ i + 1, frame->ToCString());
+ intptr_t num_locals = frame->NumLocalVariables();
+ for (intptr_t i = 0; i < num_locals; i++) {
+ intptr_t token_pos, end_pos;
+ frame->VariableAt(i, &var_name, &token_pos, &end_pos, &value);
+ OS::Print(" var %s (pos %"Pd") = %s\n",
+ var_name.ToCString(), token_pos, value.ToCString());
+ }
+ }
+}
+
+
+BreakpointHandler* Debugger::bp_handler_ = DefaultBreakpointHandler;
+Debugger::EventHandler* Debugger::event_handler_ = NULL;
+
+
class RemoteObjectCache : public ZoneAllocated {
public:
explicit RemoteObjectCache(intptr_t initial_size);
@@ -133,6 +157,16 @@
}
+void Debugger::SignalIsolateEvent(EventType type) {
+ if (event_handler_ != NULL) {
+ DebuggerEvent event;
+ event.type = type;
+ event.isolate = Isolate::Current();
+ (*event_handler_)(&event);
+ }
+}
+
+
const char* Debugger::QualifiedFunctionName(const Function& func) {
const String& func_name = String::Handle(func.name());
Class& func_class = Class::Handle(func.Owner());
@@ -598,8 +632,6 @@
Debugger::Debugger()
: isolate_(NULL),
initialized_(false),
- bp_handler_(NULL),
- event_handler_(NULL),
next_id_(1),
stack_trace_(NULL),
obj_cache_(NULL),
@@ -1239,29 +1271,9 @@
}
-static void DefaultBreakpointHandler(SourceBreakpoint* bpt,
- DebuggerStackTrace* stack) {
- String& var_name = String::Handle();
- Instance& value = Instance::Handle();
- for (intptr_t i = 0; i < stack->Length(); i++) {
- ActivationFrame* frame = stack->ActivationFrameAt(i);
- OS::Print(" %"Pd". %s\n",
- i + 1, frame->ToCString());
- intptr_t num_locals = frame->NumLocalVariables();
- for (intptr_t i = 0; i < num_locals; i++) {
- intptr_t token_pos, end_pos;
- frame->VariableAt(i, &var_name, &token_pos, &end_pos, &value);
- OS::Print(" var %s (pos %"Pd") = %s\n",
- var_name.ToCString(), token_pos, value.ToCString());
- }
- }
-}
-
-
void Debugger::SetBreakpointHandler(BreakpointHandler* handler) {
- bp_handler_ = handler;
- if (bp_handler_ == NULL) {
- bp_handler_ = &DefaultBreakpointHandler;
+ if (bp_handler_ != NULL) {
+ bp_handler_ = handler;
}
}
@@ -1405,7 +1417,6 @@
}
isolate_ = isolate;
initialized_ = true;
- SetBreakpointHandler(DefaultBreakpointHandler);
}
« vm/debugger.h ('K') | « vm/debugger.h ('k') | vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698