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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/dbg_connection_win.h ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 void DebuggerConnectionImpl::StartHandler(int port_number) { 7 #include "bin/eventhandler.h"
8 FATAL("Debugger wire protocol not yet implemented on Linux\n"); 8
9 void DebuggerConnectionImpl::ThreadEntry(uword args) {
10 ListenSocket* listen_socket =
11 reinterpret_cast<ListenSocket*>(DebuggerConnectionHandler::listener_fd_);
12 SOCKET client_socket = accept(listen_socket->socket(), NULL, NULL);
13 if (client_socket == INVALID_SOCKET) {
14 FATAL("Accepting new debugger connection failed.\n");
15 }
16 ClientSocket* socket = new ClientSocket(client_socket);
17 DebuggerConnectionHandler::AcceptDbgConnection(reinterpret_cast<int>(socket));
9 } 18 }
10 19
20
21 void DebuggerConnectionImpl::StartHandler(int port_number) {
22 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1);
23 int result = dart::Thread::Start(&DebuggerConnectionImpl::ThreadEntry, 0);
24 if (result != 0) {
25 FATAL1("Failed to start debugger connection handler thread: %d\n", result);
26 }
27 }
28
29
30 intptr_t DebuggerConnectionImpl::Send(intptr_t socket,
31 const char* buf,
32 int len) {
33 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket);
34 return send(client_socket->socket(), buf, len, 0);
35 }
36
37
38 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) {
39 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket);
40 return recv(client_socket->socket(), buf, len, 0);
41 }
OLDNEW
« 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