| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 BIN_DBG_MESSAGE_H_ | 5 #ifndef BIN_DBG_MESSAGE_H_ |
| 6 #define BIN_DBG_MESSAGE_H_ | 6 #define BIN_DBG_MESSAGE_H_ |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 Dart_IsolateId isolate_id() const { return isolate_id_; } | 154 Dart_IsolateId isolate_id() const { return isolate_id_; } |
| 155 DbgMsgQueue* next() const { return next_; } | 155 DbgMsgQueue* next() const { return next_; } |
| 156 void set_next(DbgMsgQueue* next) { next_ = next; } | 156 void set_next(DbgMsgQueue* next) { next_ = next; } |
| 157 | 157 |
| 158 // Add specified debug command message to the queue. | 158 // Add specified debug command message to the queue. |
| 159 void AddMessage(int32_t cmd_idx, | 159 void AddMessage(int32_t cmd_idx, |
| 160 const char* start, | 160 const char* start, |
| 161 const char* end, | 161 const char* end, |
| 162 int debug_fd); | 162 int debug_fd); |
| 163 | 163 |
| 164 // Handle all debug command messages in the queue. | 164 // Notify an isolate of a pending vmservice message. |
| 165 void HandleMessages(); | 165 void Notify(); |
| 166 |
| 167 // Run a message loop which handles messages as they arrive until |
| 168 // normal program execution resumes. |
| 169 void MessageLoop(); |
| 170 |
| 171 // Handle any pending debug command messages in the queue. Return |
| 172 // value indicates whether a resume has been requested. |
| 173 bool HandlePendingMessages(); |
| 166 | 174 |
| 167 // Interrupt Isolate. | 175 // Interrupt Isolate. |
| 168 void InterruptIsolate(); | 176 void InterruptIsolate(); |
| 169 | 177 |
| 170 // Queue output messages, these are sent out when we hit an event. | 178 // Queue output messages, these are sent out when we hit an event. |
| 171 void QueueOutputMsg(dart::TextBuffer* msg); | 179 void QueueOutputMsg(dart::TextBuffer* msg); |
| 172 | 180 |
| 173 // Send all queued messages over to the debugger. | 181 // Send all queued messages over to the debugger. |
| 174 void SendQueuedMsgs(); | 182 void SendQueuedMsgs(); |
| 175 | 183 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // It returns kInvalidCommand otherwise. | 226 // It returns kInvalidCommand otherwise. |
| 219 static int32_t LookupIsolateCommand(const char* buf, int32_t buflen); | 227 static int32_t LookupIsolateCommand(const char* buf, int32_t buflen); |
| 220 | 228 |
| 221 // Queue debugger message targetted for the isolate. | 229 // Queue debugger message targetted for the isolate. |
| 222 static bool AddIsolateMessage(Dart_IsolateId isolate_id, | 230 static bool AddIsolateMessage(Dart_IsolateId isolate_id, |
| 223 int32_t cmd_idx, | 231 int32_t cmd_idx, |
| 224 const char* start, | 232 const char* start, |
| 225 const char* end, | 233 const char* end, |
| 226 int debug_fd); | 234 int debug_fd); |
| 227 | 235 |
| 236 // Notify an isolate of a pending vmservice message. |
| 237 static void NotifyIsolate(Dart_Isolate isolate); |
| 238 |
| 228 // Interrupt isolate. | 239 // Interrupt isolate. |
| 229 static bool InterruptIsolate(Dart_IsolateId isolate_id); | 240 static bool InterruptIsolate(Dart_IsolateId isolate_id); |
| 230 | 241 |
| 231 // Add Debugger Message Queue corresponding to the Isolate. | 242 // Add Debugger Message Queue corresponding to the Isolate. |
| 232 static DbgMsgQueue* AddIsolateMsgQueue(Dart_IsolateId isolate_id); | 243 static DbgMsgQueue* AddIsolateMsgQueue(Dart_IsolateId isolate_id); |
| 233 | 244 |
| 234 // Get Debugger Message Queue corresponding to the Isolate. | 245 // Get Debugger Message Queue corresponding to the Isolate. |
| 235 static DbgMsgQueue* GetIsolateMsgQueue(Dart_IsolateId isolate_id); | 246 static DbgMsgQueue* GetIsolateMsgQueue(Dart_IsolateId isolate_id); |
| 236 | 247 |
| 237 // Remove Debugger Message Queue corresponding to the Isolate. | 248 // Remove Debugger Message Queue corresponding to the Isolate. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 261 static dart::Mutex* msg_queue_list_lock_; | 272 static dart::Mutex* msg_queue_list_lock_; |
| 262 | 273 |
| 263 DISALLOW_ALLOCATION(); | 274 DISALLOW_ALLOCATION(); |
| 264 DISALLOW_IMPLICIT_CONSTRUCTORS(DbgMsgQueueList); | 275 DISALLOW_IMPLICIT_CONSTRUCTORS(DbgMsgQueueList); |
| 265 }; | 276 }; |
| 266 | 277 |
| 267 } // namespace bin | 278 } // namespace bin |
| 268 } // namespace dart | 279 } // namespace dart |
| 269 | 280 |
| 270 #endif // BIN_DBG_MESSAGE_H_ | 281 #endif // BIN_DBG_MESSAGE_H_ |
| OLD | NEW |