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 #include "bin/dbg_connection.h" | 5 #include "bin/dbg_connection.h" |
6 #include "bin/dbg_message.h" | 6 #include "bin/dbg_message.h" |
7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
8 #include "bin/lockers.h" | 8 #include "bin/lockers.h" |
9 #include "bin/thread.h" | 9 #include "bin/thread.h" |
10 #include "bin/utils.h" | 10 #include "bin/utils.h" |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 if (Dart_HandleServiceMessages()) { | 1099 if (Dart_HandleServiceMessages()) { |
1100 break; | 1100 break; |
1101 } | 1101 } |
1102 | 1102 |
1103 // Handle all available debug messages, up to a resume request. | 1103 // Handle all available debug messages, up to a resume request. |
1104 if (HandlePendingMessages()) { | 1104 if (HandlePendingMessages()) { |
1105 break; | 1105 break; |
1106 } | 1106 } |
1107 | 1107 |
1108 // Wait for more debug or vm service messages. | 1108 // Wait for more debug or vm service messages. |
1109 dart::Monitor::WaitResult res = ml.Wait(); | 1109 Monitor::WaitResult res = ml.Wait(); |
1110 ASSERT(res == dart::Monitor::kNotified); | 1110 ASSERT(res == Monitor::kNotified); |
1111 } | 1111 } |
1112 Dart_SetMessageNotifyCallback(NULL); | 1112 Dart_SetMessageNotifyCallback(NULL); |
1113 is_interrupted_ = false; | 1113 is_interrupted_ = false; |
1114 is_running_ = true; | 1114 is_running_ = true; |
1115 } | 1115 } |
1116 | 1116 |
1117 | 1117 |
1118 void DbgMsgQueue::InterruptIsolate() { | 1118 void DbgMsgQueue::InterruptIsolate() { |
1119 Dart_Isolate isolate = Dart_GetIsolate(isolate_id_); | 1119 Dart_Isolate isolate = Dart_GetIsolate(isolate_id_); |
1120 MonitorLocker ml(&msg_queue_lock_); | 1120 MonitorLocker ml(&msg_queue_lock_); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 msg.Printf("\"reason\": \"shutdown\", "); | 1200 msg.Printf("\"reason\": \"shutdown\", "); |
1201 } | 1201 } |
1202 msg.Printf("\"id\": %" Pd64 " ", isolate_id); | 1202 msg.Printf("\"id\": %" Pd64 " ", isolate_id); |
1203 msg.Printf("}}"); | 1203 msg.Printf("}}"); |
1204 } | 1204 } |
1205 DebuggerConnectionHandler::BroadcastMsg(&msg); | 1205 DebuggerConnectionHandler::BroadcastMsg(&msg); |
1206 } | 1206 } |
1207 | 1207 |
1208 | 1208 |
1209 DbgMsgQueue* DbgMsgQueueList::list_ = NULL; | 1209 DbgMsgQueue* DbgMsgQueueList::list_ = NULL; |
1210 dart::Mutex* DbgMsgQueueList::msg_queue_list_lock_ = new dart::Mutex(); | 1210 Mutex* DbgMsgQueueList::msg_queue_list_lock_ = new Mutex(); |
1211 | 1211 |
1212 | 1212 |
1213 void DbgMsgQueueList::Initialize() { | 1213 void DbgMsgQueueList::Initialize() { |
1214 // Setup handlers for isolate events, breakpoints, exceptions and | 1214 // Setup handlers for isolate events, breakpoints, exceptions and |
1215 // delayed breakpoints. | 1215 // delayed breakpoints. |
1216 Dart_SetIsolateEventHandler(IsolateEventHandler); | 1216 Dart_SetIsolateEventHandler(IsolateEventHandler); |
1217 Dart_SetPausedEventHandler(PausedEventHandler); | 1217 Dart_SetPausedEventHandler(PausedEventHandler); |
1218 Dart_SetBreakpointResolvedHandler(BptResolvedHandler); | 1218 Dart_SetBreakpointResolvedHandler(BptResolvedHandler); |
1219 Dart_SetExceptionThrownHandler(ExceptionThrownHandler); | 1219 Dart_SetExceptionThrownHandler(ExceptionThrownHandler); |
1220 } | 1220 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 } else { | 1411 } else { |
1412 ASSERT(kind == kShutdown); | 1412 ASSERT(kind == kShutdown); |
1413 RemoveIsolateMsgQueue(isolate_id); | 1413 RemoveIsolateMsgQueue(isolate_id); |
1414 } | 1414 } |
1415 } | 1415 } |
1416 Dart_ExitScope(); | 1416 Dart_ExitScope(); |
1417 } | 1417 } |
1418 | 1418 |
1419 } // namespace bin | 1419 } // namespace bin |
1420 } // namespace dart | 1420 } // namespace dart |
OLD | NEW |