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

Unified Diff: runtime/bin/dbg_connection_win.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 | « runtime/bin/dbg_connection_win.h ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection_win.cc
diff --git a/runtime/bin/dbg_connection_win.cc b/runtime/bin/dbg_connection_win.cc
index 505e970a97be8533e799e1c6955fb9f9cf15332c..1c9bf54ea6edb4da1086173a1ba4f90ca79ef194 100644
--- a/runtime/bin/dbg_connection_win.cc
+++ b/runtime/bin/dbg_connection_win.cc
@@ -4,7 +4,38 @@
#include "bin/dbg_connection.h"
+#include "bin/eventhandler.h"
+
+void DebuggerConnectionImpl::ThreadEntry(uword args) {
+ ListenSocket* listen_socket =
+ reinterpret_cast<ListenSocket*>(DebuggerConnectionHandler::listener_fd_);
+ SOCKET client_socket = accept(listen_socket->socket(), NULL, NULL);
+ if (client_socket == INVALID_SOCKET) {
+ FATAL("Accepting new debugger connection failed.\n");
+ }
+ ClientSocket* socket = new ClientSocket(client_socket);
+ DebuggerConnectionHandler::AcceptDbgConnection(reinterpret_cast<int>(socket));
+}
+
+
void DebuggerConnectionImpl::StartHandler(int port_number) {
- FATAL("Debugger wire protocol not yet implemented on Linux\n");
+ ASSERT(DebuggerConnectionHandler::listener_fd_ != -1);
+ int result = dart::Thread::Start(&DebuggerConnectionImpl::ThreadEntry, 0);
+ if (result != 0) {
+ FATAL1("Failed to start debugger connection handler thread: %d\n", result);
+ }
}
+
+intptr_t DebuggerConnectionImpl::Send(intptr_t socket,
+ const char* buf,
+ int len) {
+ ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket);
+ return send(client_socket->socket(), buf, len, 0);
+}
+
+
+intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) {
+ ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket);
+ return recv(client_socket->socket(), buf, len, 0);
+}
« no previous file with comments | « runtime/bin/dbg_connection_win.h ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698