| OLD | NEW |
| 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 #ifndef BIN_DBG_CONNECTION_H_ | 5 #ifndef BIN_DBG_CONNECTION_H_ |
| 6 #define BIN_DBG_CONNECTION_H_ | 6 #define BIN_DBG_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 static void SendBreakpointEvent(Dart_Breakpoint bpt, Dart_StackTrace trace); | 39 static void SendBreakpointEvent(Dart_Breakpoint bpt, Dart_StackTrace trace); |
| 40 static void BreakpointHandler(Dart_Breakpoint bpt, Dart_StackTrace trace); | 40 static void BreakpointHandler(Dart_Breakpoint bpt, Dart_StackTrace trace); |
| 41 | 41 |
| 42 static void AcceptDbgConnection(int debug_fd); | 42 static void AcceptDbgConnection(int debug_fd); |
| 43 static void CloseDbgConnection(); | 43 static void CloseDbgConnection(); |
| 44 | 44 |
| 45 static void HandleMessages(); | 45 static void HandleMessages(); |
| 46 static void HandleResumeCmd(); | 46 static void HandleResumeCmd(const char* msg); |
| 47 static void HandleStepIntoCmd(const char* msg); |
| 48 static void HandleStepOverCmd(const char* msg); |
| 49 static void HandleStepOutCmd(const char* msg); |
| 50 static void HandleGetLibraryURLsCmd(const char* json_msg); |
| 51 static void HandleGetScriptURLsCmd(const char* json_msg); |
| 52 |
| 53 static void SendError(int msg_id, const char* format, ...); |
| 47 | 54 |
| 48 static bool handler_started_; | 55 static bool handler_started_; |
| 49 | 56 |
| 57 static bool request_resume_; |
| 58 |
| 50 // The socket that is listening for incoming debugger connections. | 59 // The socket that is listening for incoming debugger connections. |
| 51 // This descriptor is created and closed by a VM thread. | 60 // This descriptor is created and closed by a VM thread. |
| 52 static int listener_fd_; | 61 static int listener_fd_; |
| 53 | 62 |
| 54 // The socket that connects with the debugger client. | 63 // The socket that connects with the debugger client. |
| 55 // The descriptor is created by the debugger connection thread and | 64 // The descriptor is created by the debugger connection thread and |
| 56 // closed by a VM thread. | 65 // closed by a VM thread. |
| 57 static int debugger_fd_; | 66 static int debugger_fd_; |
| 58 | 67 |
| 59 // The VM thread waits on this condition variable when it reaches a | 68 // The VM thread waits on this condition variable when it reaches a |
| 60 // breakpoint and the debugger client has not connected yet. | 69 // breakpoint and the debugger client has not connected yet. |
| 61 static dart::Monitor is_connected_; | 70 static dart::Monitor is_connected_; |
| 62 | 71 |
| 63 static MessageBuffer* msgbuf_; | 72 static MessageBuffer* msgbuf_; |
| 64 | 73 |
| 65 friend class DebuggerConnectionImpl; | 74 friend class DebuggerConnectionImpl; |
| 66 | 75 |
| 67 DISALLOW_ALLOCATION(); | 76 DISALLOW_ALLOCATION(); |
| 68 DISALLOW_IMPLICIT_CONSTRUCTORS(DebuggerConnectionHandler); | 77 DISALLOW_IMPLICIT_CONSTRUCTORS(DebuggerConnectionHandler); |
| 69 }; | 78 }; |
| 70 | 79 |
| 71 #endif // BIN_DBG_CONNECTION_H_ | 80 #endif // BIN_DBG_CONNECTION_H_ |
| OLD | NEW |