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::EventKind TranslateEventKind( | 10 static ServiceEvent::EventKind TranslateEventKind( |
(...skipping 27 matching lines...) Expand all Loading... |
38 exception_(NULL), | 38 exception_(NULL), |
39 async_continuation_(NULL), | 39 async_continuation_(NULL), |
40 inspectee_(NULL), | 40 inspectee_(NULL), |
41 gc_stats_(NULL), | 41 gc_stats_(NULL), |
42 bytes_(NULL), | 42 bytes_(NULL), |
43 bytes_length_(0) { | 43 bytes_length_(0) { |
44 DebuggerEvent::EventType type = debugger_event->type(); | 44 DebuggerEvent::EventType type = debugger_event->type(); |
45 if (type == DebuggerEvent::kBreakpointReached) { | 45 if (type == DebuggerEvent::kBreakpointReached) { |
46 set_breakpoint(debugger_event->breakpoint()); | 46 set_breakpoint(debugger_event->breakpoint()); |
47 set_async_continuation(debugger_event->async_continuation()); | 47 set_async_continuation(debugger_event->async_continuation()); |
| 48 set_at_async_jump(debugger_event->at_async_jump()); |
48 } | 49 } |
49 if (type == DebuggerEvent::kExceptionThrown) { | 50 if (type == DebuggerEvent::kExceptionThrown) { |
50 set_exception(debugger_event->exception()); | 51 set_exception(debugger_event->exception()); |
51 } | 52 } |
52 if (type == DebuggerEvent::kBreakpointReached || | 53 if (type == DebuggerEvent::kBreakpointReached || |
53 type == DebuggerEvent::kIsolateInterrupted || | 54 type == DebuggerEvent::kIsolateInterrupted || |
54 type == DebuggerEvent::kExceptionThrown) { | 55 type == DebuggerEvent::kExceptionThrown) { |
55 set_top_frame(debugger_event->top_frame()); | 56 set_top_frame(debugger_event->top_frame()); |
56 } | 57 } |
57 } | 58 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 JSONObject jsFrame(&jsobj, "topFrame"); | 162 JSONObject jsFrame(&jsobj, "topFrame"); |
162 top_frame()->PrintToJSONObject(&jsFrame); | 163 top_frame()->PrintToJSONObject(&jsFrame); |
163 intptr_t index = 0; // Avoid ambiguity in call to AddProperty. | 164 intptr_t index = 0; // Avoid ambiguity in call to AddProperty. |
164 jsFrame.AddProperty("index", index); | 165 jsFrame.AddProperty("index", index); |
165 } | 166 } |
166 if (exception() != NULL) { | 167 if (exception() != NULL) { |
167 jsobj.AddProperty("exception", *(exception())); | 168 jsobj.AddProperty("exception", *(exception())); |
168 } | 169 } |
169 if (async_continuation() != NULL && !async_continuation()->IsNull()) { | 170 if (async_continuation() != NULL && !async_continuation()->IsNull()) { |
170 jsobj.AddProperty("_asyncContinuation", *(async_continuation())); | 171 jsobj.AddProperty("_asyncContinuation", *(async_continuation())); |
| 172 jsobj.AddProperty("_atAsyncJump", at_async_jump()); |
171 } | 173 } |
172 if (inspectee() != NULL) { | 174 if (inspectee() != NULL) { |
173 jsobj.AddProperty("inspectee", *(inspectee())); | 175 jsobj.AddProperty("inspectee", *(inspectee())); |
174 } | 176 } |
175 if (gc_stats() != NULL) { | 177 if (gc_stats() != NULL) { |
176 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); | 178 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); |
177 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); | 179 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); |
178 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); | 180 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); |
179 } | 181 } |
180 if (bytes() != NULL) { | 182 if (bytes() != NULL) { |
(...skipping 14 matching lines...) Expand all Loading... |
195 | 197 |
196 | 198 |
197 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const { | 199 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const { |
198 ASSERT(jsobj != NULL); | 200 ASSERT(jsobj != NULL); |
199 jsobj->AddProperty("type", "Event"); | 201 jsobj->AddProperty("type", "Event"); |
200 jsobj->AddProperty("kind", KindAsCString()); | 202 jsobj->AddProperty("kind", KindAsCString()); |
201 jsobj->AddProperty("isolate", isolate()); | 203 jsobj->AddProperty("isolate", isolate()); |
202 } | 204 } |
203 | 205 |
204 } // namespace dart | 206 } // namespace dart |
OLD | NEW |