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

Unified Diff: runtime/vm/service.cc

Issue 1100583006: Add crash dumps to service protocol and Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 87387058b04ff354e9adb4f5c9a82dd0684cd12a..4942022b9003eddbea03dc8b27803e90cd2fee5b 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -298,7 +298,10 @@ class BoolParameter : public MethodParameter {
return (strcmp("true", value) == 0) || (strcmp("false", value) == 0);
}
- static bool Parse(const char* value) {
+ static bool Parse(const char* value, bool default_value = false) {
+ if (value == NULL) {
+ return default_value;
+ }
return strcmp("true", value) == 0;
}
};
@@ -727,20 +730,25 @@ static bool GetIsolate(Isolate* isolate, JSONStream* js) {
static const MethodParameter* get_stack_params[] = {
ISOLATE_PARAMETER,
+ new BoolParameter("full", false),
NULL,
};
static bool GetStack(Isolate* isolate, JSONStream* js) {
DebuggerStackTrace* stack = isolate->debugger()->StackTrace();
+ // Do we want the complete script object and complete local variable objects?
+ // This is true for dump requests.
+ const bool full = BoolParameter::Parse(js->LookupParam("full"), false);
JSONObject jsobj(js);
jsobj.AddProperty("type", "Stack");
JSONArray jsarr(&jsobj, "frames");
+
intptr_t num_frames = stack->Length();
for (intptr_t i = 0; i < num_frames; i++) {
ActivationFrame* frame = stack->FrameAt(i);
JSONObject jsobj(&jsarr);
- frame->PrintToJSONObject(&jsobj);
+ frame->PrintToJSONObject(&jsobj, full);
// TODO(turnidge): Implement depth differently -- differentiate
// inlined frames.
jsobj.AddProperty("depth", i);

Powered by Google App Engine
This is Rietveld 408576698