| 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/dartutils.h" | 6 #include "bin/dartutils.h" |
| 7 #include "bin/socket.h" | 7 #include "bin/socket.h" |
| 8 #include "bin/thread.h" | 8 #include "bin/thread.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 | 10 |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 HandleUnknownMsg(msgbuf_->buf()); | 947 HandleUnknownMsg(msgbuf_->buf()); |
| 948 msgbuf_->PopMessage(); | 948 msgbuf_->PopMessage(); |
| 949 } | 949 } |
| 950 } | 950 } |
| 951 } | 951 } |
| 952 | 952 |
| 953 | 953 |
| 954 void DebuggerConnectionHandler::WaitForConnection() { | 954 void DebuggerConnectionHandler::WaitForConnection() { |
| 955 MonitorLocker ml(&is_connected_); | 955 MonitorLocker ml(&is_connected_); |
| 956 while (!IsConnected()) { | 956 while (!IsConnected()) { |
| 957 printf("Waiting for debugger connection...\n"); | |
| 958 dart::Monitor::WaitResult res = ml.Wait(dart::Monitor::kNoTimeout); | 957 dart::Monitor::WaitResult res = ml.Wait(dart::Monitor::kNoTimeout); |
| 959 ASSERT(res == dart::Monitor::kNotified); | 958 ASSERT(res == dart::Monitor::kNotified); |
| 960 } | 959 } |
| 961 } | 960 } |
| 962 | 961 |
| 963 | 962 |
| 964 void DebuggerConnectionHandler::SendBreakpointEvent(Dart_StackTrace trace) { | 963 void DebuggerConnectionHandler::SendBreakpointEvent(Dart_StackTrace trace) { |
| 965 dart::TextBuffer msg(128); | 964 dart::TextBuffer msg(128); |
| 966 msg.Printf("{ \"event\": \"paused\", \"params\": { "); | 965 msg.Printf("{ \"event\": \"paused\", \"params\": { "); |
| 967 msg.Printf("\"reason\": \"breakpoint\", "); | 966 msg.Printf("\"reason\": \"breakpoint\", "); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 DebuggerConnectionImpl::StartHandler(port_number); | 1066 DebuggerConnectionImpl::StartHandler(port_number); |
| 1068 Dart_SetBreakpointHandler(BreakpointHandler); | 1067 Dart_SetBreakpointHandler(BreakpointHandler); |
| 1069 Dart_SetBreakpointResolvedHandler(BptResolvedHandler); | 1068 Dart_SetBreakpointResolvedHandler(BptResolvedHandler); |
| 1070 Dart_SetExceptionThrownHandler(ExceptionThrownHandler); | 1069 Dart_SetExceptionThrownHandler(ExceptionThrownHandler); |
| 1071 } | 1070 } |
| 1072 | 1071 |
| 1073 | 1072 |
| 1074 DebuggerConnectionHandler::~DebuggerConnectionHandler() { | 1073 DebuggerConnectionHandler::~DebuggerConnectionHandler() { |
| 1075 CloseDbgConnection(); | 1074 CloseDbgConnection(); |
| 1076 } | 1075 } |
| OLD | NEW |