| 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/log.h" | 8 #include "bin/log.h" |
| 9 #include "bin/socket.h" | 9 #include "bin/socket.h" |
| 10 #include "bin/thread.h" | 10 #include "bin/thread.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 int msg_id, | 257 int msg_id, |
| 258 const char* err_msg) { | 258 const char* err_msg) { |
| 259 dart::TextBuffer msg(64); | 259 dart::TextBuffer msg(64); |
| 260 msg.Printf("{\"id\": %d, \"error\": \"Error: %s\"}", msg_id, err_msg); | 260 msg.Printf("{\"id\": %d, \"error\": \"Error: %s\"}", msg_id, err_msg); |
| 261 SendMsg(debug_fd, &msg); | 261 SendMsg(debug_fd, &msg); |
| 262 } | 262 } |
| 263 | 263 |
| 264 | 264 |
| 265 void DebuggerConnectionHandler::CloseDbgConnection() { | 265 void DebuggerConnectionHandler::CloseDbgConnection() { |
| 266 if (debug_fd_ >= 0) { | 266 if (debug_fd_ >= 0) { |
| 267 // TODO(hausner): need a Socket::Close() function. | 267 Socket::Close(debug_fd_); |
| 268 } | 268 } |
| 269 if (msgbuf_ != NULL) { | 269 if (msgbuf_ != NULL) { |
| 270 delete msgbuf_; | 270 delete msgbuf_; |
| 271 msgbuf_ = NULL; | 271 msgbuf_ = NULL; |
| 272 } | 272 } |
| 273 // TODO(hausner): Need to tell the VM debugger object to remove all | 273 // TODO(hausner): Need to tell the VM debugger object to remove all |
| 274 // breakpoints. | 274 // breakpoints. |
| 275 } | 275 } |
| 276 | 276 |
| 277 | 277 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 ASSERT(singleton_handler != NULL); | 431 ASSERT(singleton_handler != NULL); |
| 432 return singleton_handler; | 432 return singleton_handler; |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 bool DebuggerConnectionHandler::IsConnected() { | 436 bool DebuggerConnectionHandler::IsConnected() { |
| 437 // TODO(asiva): Support multiple debugger connections. | 437 // TODO(asiva): Support multiple debugger connections. |
| 438 // Return true if a connection has been established. | 438 // Return true if a connection has been established. |
| 439 return singleton_handler != NULL; | 439 return singleton_handler != NULL; |
| 440 } | 440 } |
| OLD | NEW |