OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/service_event.h" | 5 #include "vm/service_event.h" |
6 | 6 |
7 namespace dart { | 7 namespace dart { |
8 | 8 |
9 // Translate from the legacy DebugEvent to a ServiceEvent. | 9 // Translate from the legacy DebugEvent to a ServiceEvent. |
10 static ServiceEvent::EventType TranslateEventType( | 10 static ServiceEvent::EventType TranslateEventType( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 JSONObject jsobj(js); | 95 JSONObject jsobj(js); |
96 jsobj.AddProperty("type", "ServiceEvent"); | 96 jsobj.AddProperty("type", "ServiceEvent"); |
97 jsobj.AddProperty("eventType", EventTypeToCString(type())); | 97 jsobj.AddProperty("eventType", EventTypeToCString(type())); |
98 jsobj.AddProperty("isolate", isolate()); | 98 jsobj.AddProperty("isolate", isolate()); |
99 if (breakpoint() != NULL) { | 99 if (breakpoint() != NULL) { |
100 jsobj.AddProperty("breakpoint", breakpoint()); | 100 jsobj.AddProperty("breakpoint", breakpoint()); |
101 } | 101 } |
102 if (top_frame() != NULL) { | 102 if (top_frame() != NULL) { |
103 JSONObject jsFrame(&jsobj, "topFrame"); | 103 JSONObject jsFrame(&jsobj, "topFrame"); |
104 top_frame()->PrintToJSONObject(&jsFrame); | 104 top_frame()->PrintToJSONObject(&jsFrame); |
| 105 intptr_t index = 0; // Avoid ambiguity in call to AddProperty. |
| 106 jsFrame.AddProperty("index", index); |
105 } | 107 } |
106 if (exception() != NULL) { | 108 if (exception() != NULL) { |
107 jsobj.AddProperty("exception", *(exception())); | 109 jsobj.AddProperty("exception", *(exception())); |
108 } | 110 } |
109 if (inspectee() != NULL) { | 111 if (inspectee() != NULL) { |
110 jsobj.AddProperty("inspectee", *(inspectee())); | 112 jsobj.AddProperty("inspectee", *(inspectee())); |
111 } | 113 } |
112 if (gc_stats() != NULL) { | 114 if (gc_stats() != NULL) { |
113 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); | 115 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); |
114 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); | 116 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); |
115 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); | 117 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); |
116 } | 118 } |
117 } | 119 } |
118 | 120 |
119 } // namespace dart | 121 } // namespace dart |
OLD | NEW |