Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 797723004: Fix resume from breakpoint in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 MonitorLocker ml(&msg_queue_lock_); 1089 MonitorLocker ml(&msg_queue_lock_);
1090 is_running_ = false; 1090 is_running_ = false;
1091 1091
1092 // Request notification on isolate messages. This allows us to 1092 // Request notification on isolate messages. This allows us to
1093 // respond to vm service messages while at breakpoint. 1093 // respond to vm service messages while at breakpoint.
1094 Dart_SetMessageNotifyCallback(DbgMsgQueueList::NotifyIsolate); 1094 Dart_SetMessageNotifyCallback(DbgMsgQueueList::NotifyIsolate);
1095 1095
1096 while (true) { 1096 while (true) {
1097 // Handle all available vm service messages, up to a resume 1097 // Handle all available vm service messages, up to a resume
1098 // request. 1098 // request.
1099 while (Dart_HasServiceMessages()) { 1099 bool resume = false;
1100 while (!resume && Dart_HasServiceMessages()) {
1100 // Release the message queue lock before handling service 1101 // Release the message queue lock before handling service
1101 // messages. This allows notifications to come in while we are 1102 // messages. This allows notifications to come in while we are
1102 // processing long requests and avoids deadlock with the PortMap 1103 // processing long requests and avoids deadlock with the PortMap
1103 // lock in the vm. 1104 // lock in the vm.
1104 msg_queue_lock_.Exit(); 1105 msg_queue_lock_.Exit();
1105 bool resume = Dart_HandleServiceMessages(); 1106 resume = Dart_HandleServiceMessages();
1106 msg_queue_lock_.Enter(); 1107 msg_queue_lock_.Enter();
1107 if (resume) { 1108 }
1108 // Resume requested through the vm service. 1109 if (resume) {
1109 break; 1110 break;
1110 }
1111 } 1111 }
1112 1112
1113 // Handle all available debug messages, up to a resume request. 1113 // Handle all available debug messages, up to a resume request.
1114 if (HandlePendingMessages()) { 1114 if (HandlePendingMessages()) {
1115 break; 1115 break;
1116 } 1116 }
1117 1117
1118 // Wait for more debug or vm service messages. 1118 // Wait for more debug or vm service messages.
1119 Monitor::WaitResult res = ml.Wait(); 1119 Monitor::WaitResult res = ml.Wait();
1120 ASSERT(res == Monitor::kNotified); 1120 ASSERT(res == Monitor::kNotified);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 } else { 1421 } else {
1422 ASSERT(kind == kShutdown); 1422 ASSERT(kind == kShutdown);
1423 RemoveIsolateMsgQueue(isolate_id); 1423 RemoveIsolateMsgQueue(isolate_id);
1424 } 1424 }
1425 } 1425 }
1426 Dart_ExitScope(); 1426 Dart_ExitScope();
1427 } 1427 }
1428 1428
1429 } // namespace bin 1429 } // namespace bin
1430 } // namespace dart 1430 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698