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

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

Issue 10365015: More windows fixes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months 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/dartutils.h" 6 #include "bin/dartutils.h"
7 #include "bin/fdutils.h" 7 #include "bin/fdutils.h"
8 #include "bin/socket.h" 8 #include "bin/socket.h"
9 #include "bin/thread.h" 9 #include "bin/thread.h"
10 #include "bin/utils.h" 10 #include "bin/utils.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ASSERT(IsValidJSON(msg.buf())); 218 ASSERT(IsValidJSON(msg.buf()));
219 } 219 }
220 220
221 221
222 void DebuggerConnectionHandler::BreakpointHandler(Dart_Breakpoint bpt, 222 void DebuggerConnectionHandler::BreakpointHandler(Dart_Breakpoint bpt,
223 Dart_StackTrace trace) { 223 Dart_StackTrace trace) {
224 // TODO(hausner): rather than busy-waiting, block on the pipe to the 224 // TODO(hausner): rather than busy-waiting, block on the pipe to the
225 // debugger thread and wait until a debugger connection has been 225 // debugger thread and wait until a debugger connection has been
226 // established. 226 // established.
227 while (!IsConnected()) { 227 while (!IsConnected()) {
228 printf("Waiting for debugger connection\n"); 228 // Busy wait.
229 sleep(1);
230 } 229 }
231 SendBreakpointEvent(bpt, trace); 230 SendBreakpointEvent(bpt, trace);
232 HandleMessages(); 231 HandleMessages();
233 if (!msgbuf_->Alive()) { 232 if (!msgbuf_->Alive()) {
234 CloseDbgConnection(); 233 CloseDbgConnection();
235 } 234 }
236 } 235 }
237 236
238 237
239 void DebuggerConnectionHandler::AcceptDbgConnection(int debugger_fd) { 238 void DebuggerConnectionHandler::AcceptDbgConnection(int debugger_fd) {
(...skipping 24 matching lines...) Expand all
264 263
265 handler_started_ = true; 264 handler_started_ = true;
266 DebuggerConnectionImpl::StartHandler(port_number); 265 DebuggerConnectionImpl::StartHandler(port_number);
267 Dart_SetBreakpointHandler(BreakpointHandler); 266 Dart_SetBreakpointHandler(BreakpointHandler);
268 } 267 }
269 268
270 269
271 DebuggerConnectionHandler::~DebuggerConnectionHandler() { 270 DebuggerConnectionHandler::~DebuggerConnectionHandler() {
272 CloseDbgConnection(); 271 CloseDbgConnection();
273 } 272 }
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