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 #ifndef VM_SERVICE_EVENT_H_ | 5 #ifndef VM_SERVICE_EVENT_H_ |
6 #define VM_SERVICE_EVENT_H_ | 6 #define VM_SERVICE_EVENT_H_ |
7 | 7 |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 | 9 |
10 class DebuggerEvent; | 10 class DebuggerEvent; |
(...skipping 16 matching lines...) Expand all Loading... |
27 kBreakpointAdded, | 27 kBreakpointAdded, |
28 kBreakpointResolved, | 28 kBreakpointResolved, |
29 kBreakpointRemoved, | 29 kBreakpointRemoved, |
30 kInspect, | 30 kInspect, |
31 kDebuggerSettingsUpdate, | 31 kDebuggerSettingsUpdate, |
32 | 32 |
33 kGC, | 33 kGC, |
34 | 34 |
35 kEmbedder, | 35 kEmbedder, |
36 | 36 |
| 37 kLogging, |
| 38 |
37 kIllegal, | 39 kIllegal, |
38 }; | 40 }; |
39 | 41 |
| 42 struct LogRecord { |
| 43 int64_t sequence_number; |
| 44 int64_t timestamp; |
| 45 intptr_t level; |
| 46 const String* name; |
| 47 const String* message; |
| 48 const Instance* zone; |
| 49 const Object* error; |
| 50 const Instance* stack_trace; |
| 51 }; |
| 52 |
40 ServiceEvent(Isolate* isolate, EventKind event_kind) | 53 ServiceEvent(Isolate* isolate, EventKind event_kind) |
41 : isolate_(isolate), | 54 : isolate_(isolate), |
42 kind_(event_kind), | 55 kind_(event_kind), |
43 embedder_kind_(NULL), | 56 embedder_kind_(NULL), |
44 embedder_stream_id_(NULL), | 57 embedder_stream_id_(NULL), |
45 breakpoint_(NULL), | 58 breakpoint_(NULL), |
46 top_frame_(NULL), | 59 top_frame_(NULL), |
47 exception_(NULL), | 60 exception_(NULL), |
48 async_continuation_(NULL), | 61 async_continuation_(NULL), |
49 inspectee_(NULL), | 62 inspectee_(NULL), |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 144 |
132 intptr_t bytes_length() const { | 145 intptr_t bytes_length() const { |
133 return bytes_length_; | 146 return bytes_length_; |
134 } | 147 } |
135 | 148 |
136 void set_bytes(const uint8_t* bytes, intptr_t bytes_length) { | 149 void set_bytes(const uint8_t* bytes, intptr_t bytes_length) { |
137 bytes_ = bytes; | 150 bytes_ = bytes; |
138 bytes_length_ = bytes_length; | 151 bytes_length_ = bytes_length; |
139 } | 152 } |
140 | 153 |
| 154 void set_log_record(const LogRecord& log_record) { |
| 155 log_record_ = log_record; |
| 156 } |
| 157 |
141 void PrintJSON(JSONStream* js) const; | 158 void PrintJSON(JSONStream* js) const; |
142 | 159 |
| 160 void PrintJSONHeader(JSONObject* jsobj) const; |
| 161 |
143 private: | 162 private: |
144 Isolate* isolate_; | 163 Isolate* isolate_; |
145 EventKind kind_; | 164 EventKind kind_; |
146 const char* embedder_kind_; | 165 const char* embedder_kind_; |
147 const char* embedder_stream_id_; | 166 const char* embedder_stream_id_; |
148 Breakpoint* breakpoint_; | 167 Breakpoint* breakpoint_; |
149 ActivationFrame* top_frame_; | 168 ActivationFrame* top_frame_; |
150 const Object* exception_; | 169 const Object* exception_; |
151 const Object* async_continuation_; | 170 const Object* async_continuation_; |
152 const Object* inspectee_; | 171 const Object* inspectee_; |
153 const Heap::GCStats* gc_stats_; | 172 const Heap::GCStats* gc_stats_; |
154 const uint8_t* bytes_; | 173 const uint8_t* bytes_; |
155 intptr_t bytes_length_; | 174 intptr_t bytes_length_; |
| 175 LogRecord log_record_; |
156 }; | 176 }; |
157 | 177 |
158 } // namespace dart | 178 } // namespace dart |
159 | 179 |
160 #endif // VM_SERVICE_EVENT_H_ | 180 #endif // VM_SERVICE_EVENT_H_ |
OLD | NEW |