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

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
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 31232)
+++ runtime/vm/debugger.cc (working copy)
@@ -14,6 +14,7 @@
#include "vm/flags.h"
#include "vm/globals.h"
#include "vm/longjump.h"
+#include "vm/json_stream.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/os.h"
@@ -84,7 +85,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();
@@ -119,11 +120,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,
@@ -219,6 +248,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()));
}
@@ -1446,7 +1484,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 =
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698