| 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/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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 delete msg; | 217 delete msg; |
| 218 break; | 218 break; |
| 219 } | 219 } |
| 220 i++; | 220 i++; |
| 221 } | 221 } |
| 222 if (!is_handled) { | 222 if (!is_handled) { |
| 223 // Check if this is an isolate specific command. | 223 // Check if this is an isolate specific command. |
| 224 int32_t cmd_idx = DbgMsgQueueList::LookupIsolateCommand(r.ValueChars(), | 224 int32_t cmd_idx = DbgMsgQueueList::LookupIsolateCommand(r.ValueChars(), |
| 225 r.ValueLen()); | 225 r.ValueLen()); |
| 226 if (cmd_idx != DbgMsgQueueList::kInvalidCommand) { | 226 if (cmd_idx != DbgMsgQueueList::kInvalidCommand) { |
| 227 const char* start = msgbuf_->buf(); |
| 228 const char* end = r.EndOfObject(); |
| 227 // Get debug message queue corresponding to isolate. | 229 // Get debug message queue corresponding to isolate. |
| 228 // TODO(asiva): Once we have support for including the isolate id | 230 MessageParser msg_parser(start, (end - start)); |
| 229 // in the debug wire protocol we need to read the isolate id and | 231 Dart_IsolateId isolate_id = |
| 230 // pass it down to AddIsolateMessage. | 232 static_cast<Dart_IsolateId>(msg_parser.GetIntParam("isolateId")); |
| 231 if (!DbgMsgQueueList::AddIsolateMessage(ILLEGAL_ISOLATE_ID, | 233 if (!DbgMsgQueueList::AddIsolateMessage(isolate_id, |
| 232 cmd_idx, | 234 cmd_idx, |
| 233 msgbuf_->buf(), | 235 msgbuf_->buf(), |
| 234 r.EndOfObject(), | 236 r.EndOfObject(), |
| 235 debug_fd_)) { | 237 debug_fd_)) { |
| 236 SendError(debug_fd_, MessageId(), "Invalid isolate specified"); | 238 SendError(debug_fd_, MessageId(), "Invalid isolate specified"); |
| 237 } | 239 } |
| 238 msgbuf_->PopMessage(); | 240 msgbuf_->PopMessage(); |
| 239 continue; | 241 continue; |
| 240 } | 242 } |
| 241 | 243 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 ASSERT(singleton_handler != NULL); | 422 ASSERT(singleton_handler != NULL); |
| 421 return singleton_handler; | 423 return singleton_handler; |
| 422 } | 424 } |
| 423 | 425 |
| 424 | 426 |
| 425 bool DebuggerConnectionHandler::IsConnected() { | 427 bool DebuggerConnectionHandler::IsConnected() { |
| 426 // TODO(asiva): Support multiple debugger connections. | 428 // TODO(asiva): Support multiple debugger connections. |
| 427 // Return true if a connection has been established. | 429 // Return true if a connection has been established. |
| 428 return singleton_handler != NULL; | 430 return singleton_handler != NULL; |
| 429 } | 431 } |
| OLD | NEW |