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

Unified Diff: runtime/bin/dbg_connection.cc

Issue 11642019: Implement debugger connection on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Enable debugger test on Windows Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/dbg_connection_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
diff --git a/runtime/bin/dbg_connection.cc b/runtime/bin/dbg_connection.cc
index 4918d0d27e564a66205ccdbf95d7231ee254e003..b6f261f83c2e0913bc26cb84553564c53e4c8ec5 100644
--- a/runtime/bin/dbg_connection.cc
+++ b/runtime/bin/dbg_connection.cc
@@ -108,7 +108,8 @@ void MessageBuffer::ReadData() {
}
// TODO(hausner): Handle error conditions returned by Read. We may
// want to close the debugger connection if we get any errors.
- int bytes_read = Socket::Read(fd_, buf_ + data_length_, max_read);
+ int bytes_read =
+ DebuggerConnectionImpl::Receive(fd_, buf_ + data_length_, max_read);
if (bytes_read == 0) {
connection_is_alive_ = false;
return;
@@ -284,6 +285,11 @@ void DebuggerConnectionHandler::StartHandler(const char* address,
// First setup breakpoint, exception and delayed breakpoint handlers.
DbgMsgQueueList::Initialize();
+ // Initialize the socket implementation.
+ if (!Socket::Initialize()) {
+ FATAL("Failed initializing socket implementation.");
+ }
+
// Now setup a listener socket and start a thread which will
// listen, accept connections from debuggers, read and handle/dispatch
// debugger commands received on these connections.
@@ -335,7 +341,7 @@ void DebuggerConnectionHandler::SendMsgHelper(int debug_fd,
piece_len = max_piece_len;
}
intptr_t written =
- Socket::Write(debug_fd, msg->buf() + sent, piece_len);
+ DebuggerConnectionImpl::Send(debug_fd, msg->buf() + sent, piece_len);
ASSERT(written == piece_len);
sent += written;
remaining -= written;
@@ -347,7 +353,8 @@ void DebuggerConnectionHandler::SendMsgHelper(int debug_fd,
}
return;
}
- intptr_t bytes_written = Socket::Write(debug_fd, msg->buf(), msg->length());
+ intptr_t bytes_written =
+ DebuggerConnectionImpl::Send(debug_fd, msg->buf(), msg->length());
ASSERT(msg->length() == bytes_written);
// TODO(hausner): Error checking. Probably just shut down the debugger
// session if we there is an error while writing.
« no previous file with comments | « no previous file | runtime/bin/dbg_connection_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698