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

Unified Diff: runtime/vm/debugger.cc

Issue 1150303004: Switch to using SourceLocation universally in service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: post merge Created 5 years, 7 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 | « runtime/observatory/tests/service/steal_breakpoint_test.dart ('k') | runtime/vm/debugger_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 57190db0f7c3dc10a938481ec96589881ea5a046..d5d82c729f445a695b2614ff4e91e58244f31bb7 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -199,12 +199,7 @@ void Breakpoint::PrintJSON(JSONStream* stream) {
Script& script = Script::Handle(isolate);
intptr_t token_pos;
bpt_location_->GetCodeLocation(&library, &script, &token_pos);
- {
- JSONObject location(&jsobj, "location");
- location.AddProperty("type", "Location");
- location.AddProperty("script", script);
- location.AddProperty("tokenPos", token_pos);
- }
+ jsobj.AddLocation(script, token_pos);
}
@@ -1004,10 +999,15 @@ void ActivationFrame::PrintToJSONObject(JSONObject* jsobj,
bool full) {
const Script& script = Script::Handle(SourceScript());
jsobj->AddProperty("type", "Frame");
- jsobj->AddProperty("script", script, !full);
- jsobj->AddProperty("tokenPos", TokenPos());
+ jsobj->AddLocation(script, TokenPos());
jsobj->AddProperty("function", function(), !full);
jsobj->AddProperty("code", code());
+ if (full) {
+ // TODO(cutch): The old "full" script usage no longer fits
+ // in the world where we pass the script as part of the
+ // location.
+ jsobj->AddProperty("script", script, !full);
+ }
{
JSONArray jsvars(jsobj, "vars");
const int num_vars = NumLocalVariables();
@@ -1020,8 +1020,11 @@ void ActivationFrame::PrintToJSONObject(JSONObject* jsobj,
VariableAt(v, &var_name, &token_pos, &end_token_pos, &var_value);
jsvar.AddProperty("name", var_name.ToCString());
jsvar.AddProperty("value", var_value, !full);
- jsvar.AddProperty("tokenPos", token_pos);
- jsvar.AddProperty("endTokenPos", end_token_pos);
+ // TODO(turnidge): Do we really want to provide this on every
+ // stack dump? Should be associated with the function object, I
+ // think, and not the stack frame.
+ jsvar.AddProperty("_tokenPos", token_pos);
+ jsvar.AddProperty("_endTokenPos", end_token_pos);
}
}
}
« no previous file with comments | « runtime/observatory/tests/service/steal_breakpoint_test.dart ('k') | runtime/vm/debugger_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698