Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc |
| index c1ef49a3f2ca022fb2738339dd97fe790feb6cf3..a0c93f94507ef9dc30d6f1171372b1e755160137 100644 |
| --- a/runtime/vm/debugger.cc |
| +++ b/runtime/vm/debugger.cc |
| @@ -144,7 +144,8 @@ void SourceBreakpoint::PrintJSON(JSONStream* stream) { |
| JSONObject jsobj(stream); |
| jsobj.AddProperty("type", "Breakpoint"); |
| - jsobj.AddProperty("id", id()); |
| + jsobj.AddPropertyF("id", "debug/breakpoints/%" Pd "", id()); |
| + jsobj.AddProperty("idNum", id()); |
|
Cutch
2014/07/15 19:42:34
Is there a better name than "idNum" Also, it seems
turnidge
2014/07/15 23:37:24
Is redundant, but that lets us treat "id" as an op
|
| jsobj.AddProperty("enabled", IsEnabled()); |
| jsobj.AddProperty("resolved", IsResolved()); |
| @@ -155,9 +156,7 @@ void SourceBreakpoint::PrintJSON(JSONStream* stream) { |
| { |
| JSONObject location(&jsobj, "location"); |
| location.AddProperty("type", "Location"); |
| - |
| - const String& url = String::Handle(script.url()); |
| - location.AddProperty("script", url.ToCString()); |
| + location.AddProperty("script", script); |
| location.AddProperty("tokenPos", token_pos); |
| } |
| } |
| @@ -527,7 +526,8 @@ void DebuggerEvent::PrintJSON(JSONStream* js) const { |
| jsobj.AddProperty("id", ""); |
| jsobj.AddProperty("eventType", EventTypeToCString(type())); |
| jsobj.AddProperty("isolate", isolate()); |
| - if (type() == kBreakpointResolved || type() == kBreakpointReached) { |
| + if ((type() == kBreakpointResolved || type() == kBreakpointReached) && |
| + breakpoint() != NULL) { |
| jsobj.AddProperty("breakpoint", breakpoint()); |
| } |
| if (type() == kExceptionThrown) { |
| @@ -2215,6 +2215,9 @@ bool Debugger::IsDebuggable(const Function& func) { |
| if (!IsDebuggableFunctionKind(func)) { |
| return false; |
| } |
| + if (Service::IsRunning()) { |
| + return true; |
| + } |
| const Class& cls = Class::Handle(func.Owner()); |
| const Library& lib = Library::Handle(cls.library()); |
| return lib.IsDebuggable(); |
| @@ -2491,10 +2494,17 @@ void Debugger::RemoveBreakpoint(intptr_t bp_id) { |
| } else { |
| prev_bpt->set_next(curr_bpt->next()); |
| } |
| + |
| // Remove references from code breakpoints to this source breakpoint, |
| // and disable the code breakpoints. |
| UnlinkCodeBreakpoints(curr_bpt); |
| delete curr_bpt; |
| + |
| + // Remove references from the current debugger pause event. |
| + if (pause_event_->type() == DebuggerEvent::kBreakpointReached && |
| + pause_event_->breakpoint() == curr_bpt) { |
| + pause_event_->set_breakpoint(NULL); |
| + } |
| return; |
| } |
| prev_bpt = curr_bpt; |