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

Unified Diff: runtime/vm/debugger.cc

Issue 113513004: Handle vmservice messages while at breakpoint. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 31070)
+++ runtime/vm/debugger.cc (working copy)
@@ -86,7 +86,7 @@
void SourceBreakpoint::GetCodeLocation(
Library* lib,
Script* script,
- intptr_t* pos) {
+ intptr_t* pos) const {
const Function& func = Function::Handle(function_);
const Class& cls = Class::Handle(func.origin());
*lib = cls.library();
@@ -121,11 +121,39 @@
}
+void SourceBreakpoint::PrintToJSONStream(JSONStream* stream) const {
+ Isolate* isolate = Isolate::Current();
+ JSONObject jsobj(stream);
+ jsobj.AddProperty("type", "Breakpoint");
+
+ jsobj.AddProperty("id", id());
+ jsobj.AddProperty("enabled", IsEnabled());
+
+ const Function& func = Function::Handle(function());
+ jsobj.AddProperty("resolved", func.HasCode());
+
+ Library& library = Library::Handle(isolate);
+ Script& script = Script::Handle(isolate);
+ intptr_t token_pos;
+ GetCodeLocation(&library, &script, &token_pos);
+ {
+ JSONObject location(&jsobj, "location");
+ location.AddProperty("type", "Location");
+ location.AddProperty("libId", library.index());
+
+ const String& url = String::Handle(script.url());
+ location.AddProperty("script", url.ToCString());
+ location.AddProperty("tokenPos", token_pos);
+ }
+}
+
+
void CodeBreakpoint::VisitObjectPointers(ObjectPointerVisitor* visitor) {
visitor->VisitPointer(reinterpret_cast<RawObject**>(&function_));
}
+
ActivationFrame::ActivationFrame(
uword pc,
uword fp,
@@ -221,6 +249,15 @@
}
+void Debugger::PrintBreakpointsToJSONArray(JSONArray* jsarr) const {
+ SourceBreakpoint* sbpt = src_breakpoints_;
+ while (sbpt != NULL) {
+ jsarr->AddValue(sbpt);
+ sbpt = sbpt->next_;
+ }
+}
+
+
RawString* ActivationFrame::QualifiedFunctionName() {
return String::New(Debugger::QualifiedFunctionName(function()));
}
@@ -1588,7 +1625,7 @@
SourceBreakpoint* Debugger::SetBreakpointAtLine(const String& script_url,
- intptr_t line_number) {
+ intptr_t line_number) {
Library& lib = Library::Handle(isolate_);
Script& script = Script::Handle(isolate_);
const GrowableObjectArray& libs =

Powered by Google App Engine
This is Rietveld 408576698