| 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/log.h" | 9 #include "bin/log.h" |
| 10 #include "bin/socket.h" | 10 #include "bin/socket.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 handler->HandleMessages(); | 448 handler->HandleMessages(); |
| 449 delete handler; | 449 delete handler; |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 | 453 |
| 454 void DebuggerConnectionHandler::HandleInterruptCmd(DbgMessage* in_msg) { | 454 void DebuggerConnectionHandler::HandleInterruptCmd(DbgMessage* in_msg) { |
| 455 MessageParser msg_parser(in_msg->buffer(), in_msg->buffer_len()); | 455 MessageParser msg_parser(in_msg->buffer(), in_msg->buffer_len()); |
| 456 int msg_id = msg_parser.MessageId(); | 456 int msg_id = msg_parser.MessageId(); |
| 457 Dart_IsolateId isolate_id = msg_parser.GetInt64Param("isolateId"); | 457 Dart_IsolateId isolate_id = msg_parser.GetInt64Param("isolateId"); |
| 458 if (isolate_id == DART_ILLEGAL_ISOLATE_ID || | 458 if (isolate_id == ILLEGAL_ISOLATE_ID || Dart_GetIsolate(isolate_id) == NULL) { |
| 459 Dart_GetIsolate(isolate_id) == DART_ILLEGAL_ISOLATE) { | |
| 460 in_msg->SendErrorReply(msg_id, "Invalid isolate specified"); | 459 in_msg->SendErrorReply(msg_id, "Invalid isolate specified"); |
| 461 return; | 460 return; |
| 462 } | 461 } |
| 463 if (!DbgMsgQueueList::InterruptIsolate(isolate_id)) { | 462 if (!DbgMsgQueueList::InterruptIsolate(isolate_id)) { |
| 464 in_msg->SendErrorReply(msg_id, "Invalid isolate specified"); | 463 in_msg->SendErrorReply(msg_id, "Invalid isolate specified"); |
| 465 return; | 464 return; |
| 466 } | 465 } |
| 467 dart::TextBuffer msg(64); | 466 dart::TextBuffer msg(64); |
| 468 msg.Printf("{ \"id\": %d }", msg_id); | 467 msg.Printf("{ \"id\": %d }", msg_id); |
| 469 in_msg->SendReply(&msg); | 468 in_msg->SendReply(&msg); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 | 507 |
| 509 | 508 |
| 510 bool DebuggerConnectionHandler::IsConnected() { | 509 bool DebuggerConnectionHandler::IsConnected() { |
| 511 // TODO(asiva): Support multiple debugger connections. | 510 // TODO(asiva): Support multiple debugger connections. |
| 512 // Return true if a connection has been established. | 511 // Return true if a connection has been established. |
| 513 return singleton_handler != NULL; | 512 return singleton_handler != NULL; |
| 514 } | 513 } |
| 515 | 514 |
| 516 } // namespace bin | 515 } // namespace bin |
| 517 } // namespace dart | 516 } // namespace dart |
| OLD | NEW |