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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/dbg_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.h
===================================================================
--- runtime/bin/dbg_connection.h (revision 0)
+++ runtime/bin/dbg_connection.h (revision 0)
@@ -0,0 +1,67 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef BIN_DBG_CONNECTION_H_
+#define BIN_DBG_CONNECTION_H_
+
+#include "bin/builtin.h"
+#include "bin/utils.h"
+
+#include "include/dart_debugger_api.h"
+
+#include "platform/globals.h"
+#include "platform/thread.h"
+// Declare the OS-specific types ahead of defining the generic class.
+#if defined(TARGET_OS_LINUX)
+#include "bin/dbg_connection_linux.h"
+#elif defined(TARGET_OS_MACOS)
+#include "bin/dbg_connection_macos.h"
+#elif defined(TARGET_OS_WINDOWS)
+#include "bin/dbg_connection_win.h"
+#else
+#error Unknown target os.
+#endif
+
+
+class MessageBuffer;
+
+class DebuggerConnectionHandler {
+ public:
+ ~DebuggerConnectionHandler();
+ static void StartHandler(const char* address, int port_number);
+
+ static bool IsConnected() {
+ return debugger_fd_ >= 0;
+ }
+
+ private:
+ static void SendBreakpointEvent(Dart_Breakpoint bpt, Dart_StackTrace trace);
+ static void BreakpointHandler(Dart_Breakpoint bpt, Dart_StackTrace trace);
+
+ static void AcceptDbgConnection(int debug_fd);
+ static void CloseDbgConnection();
+
+ static void HandleMessages();
+ static void HandleResumeCmd();
+
+ static bool handler_started_;
+
+ // The socket that is listening for incoming debugger connections.
+ // This descriptor is created and closed by a VM thread.
+ static int listener_fd_;
+
+ // The socket that connects with the debugger client.
+ // The descriptor is created by the debugger connection thread and
+ // closed by a VM thread.
+ static int debugger_fd_;
+
+ static MessageBuffer* msgbuf_;
+
+ friend class DebuggerConnectionImpl;
+
+ DISALLOW_ALLOCATION();
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DebuggerConnectionHandler);
+};
+
+#endif // BIN_DBG_CONNECTION_H_
« 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