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); |