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

Side by Side Diff: runtime/bin/dbg_connection.h

Issue 10357003: Beginnings of a debugger wire protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months 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/builtin_impl_sources.gypi ('k') | runtime/bin/dbg_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef BIN_DBG_CONNECTION_H_
6 #define BIN_DBG_CONNECTION_H_
7
8 #include "bin/builtin.h"
9 #include "bin/utils.h"
10
11 #include "include/dart_debugger_api.h"
12
13 #include "platform/globals.h"
14 #include "platform/thread.h"
15 // Declare the OS-specific types ahead of defining the generic class.
16 #if defined(TARGET_OS_LINUX)
17 #include "bin/dbg_connection_linux.h"
18 #elif defined(TARGET_OS_MACOS)
19 #include "bin/dbg_connection_macos.h"
20 #elif defined(TARGET_OS_WINDOWS)
21 #include "bin/dbg_connection_win.h"
22 #else
23 #error Unknown target os.
24 #endif
25
26
27 class MessageBuffer;
28
29 class DebuggerConnectionHandler {
30 public:
31 ~DebuggerConnectionHandler();
32 static void StartHandler(const char* address, int port_number);
33
34 static bool IsConnected() {
35 return debugger_fd_ >= 0;
36 }
37
38 private:
39 static void SendBreakpointEvent(Dart_Breakpoint bpt, Dart_StackTrace trace);
40 static void BreakpointHandler(Dart_Breakpoint bpt, Dart_StackTrace trace);
41
42 static void AcceptDbgConnection(int debug_fd);
43 static void CloseDbgConnection();
44
45 static void HandleMessages();
46 static void HandleResumeCmd();
47
48 static bool handler_started_;
49
50 // The socket that is listening for incoming debugger connections.
51 // This descriptor is created and closed by a VM thread.
52 static int listener_fd_;
53
54 // The socket that connects with the debugger client.
55 // The descriptor is created by the debugger connection thread and
56 // closed by a VM thread.
57 static int debugger_fd_;
58
59 static MessageBuffer* msgbuf_;
60
61 friend class DebuggerConnectionImpl;
62
63 DISALLOW_ALLOCATION();
64 DISALLOW_IMPLICIT_CONSTRUCTORS(DebuggerConnectionHandler);
65 };
66
67 #endif // BIN_DBG_CONNECTION_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/dbg_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698