OLD | NEW |
| (Empty) |
1 // Copyright 2009 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can | |
3 // be found in the LICENSE file. | |
4 #ifndef NACLVSX_DEBUGHELPERS_TRANSPORT_H_ | |
5 #define NACLVSX_DEBUGHELPERS_TRANSPORT_H_ | |
6 | |
7 #include "src/NaClVsx.DebugHelpers/Registers.h" | |
8 | |
9 namespace NaClVsx { | |
10 namespace DebugHelpers { | |
11 | |
12 struct GdbProxyImpl; | |
13 | |
14 public ref class GdbProxy { | |
15 public: | |
16 GdbProxy(void); | |
17 ~GdbProxy(); | |
18 | |
19 // | |
20 // Please keep this enum in sync with the one in debug_host.h | |
21 // | |
22 enum class ResultCode { | |
23 DHR_BUSY = -4, // Target is busy (running) | |
24 DHR_FAILED = -3, // Transaction completed with failure | |
25 DHR_LOST = -2, // Lost connection during transaction | |
26 DHR_TIMEOUT =-1, // Transaction Timed out | |
27 DHR_PENDING = 0, // Transaction is pending as expected | |
28 DHR_OK = 1 // Transaction Succeeded | |
29 }; | |
30 delegate void AsyncResponse(ResultCode result, | |
31 System::String^ msg, | |
32 array<System::Byte>^ data); | |
33 | |
34 static bool CanConnect(System::String^ connectionString); | |
35 static bool CanConnect(int pid) { | |
36 pid; // unreferenced | |
37 return true; | |
38 } | |
39 | |
40 void Open(System::String^ connectionString); | |
41 void Close(); | |
42 | |
43 void WaitForReply(); | |
44 | |
45 bool IsRunning(); | |
46 void SetOutputAsync(AsyncResponse^ reply); | |
47 void SetStopAsync(AsyncResponse^ reply); | |
48 | |
49 ResultCode GetArch(AsyncResponse^ reply); | |
50 ResultCode GetThreads(AsyncResponse^ reply); | |
51 | |
52 ResultCode GetLastSig([System::Runtime::InteropServices::Out]int% sig); | |
53 | |
54 ResultCode GetMemory( | |
55 System::UInt64 offs, System::Array^ data, System::UInt32 count); | |
56 ResultCode SetMemory( | |
57 System::UInt64 offs, System::Array^ data, System::UInt32 count); | |
58 | |
59 ResultCode GetRegisters(RegsX86_64^% registers); | |
60 ResultCode SetRegisters(void *data, System::UInt32 size); | |
61 | |
62 ResultCode RequestBreak(); | |
63 ResultCode RequestContinue(); | |
64 ResultCode RequestStep(); | |
65 | |
66 bool HasBreakpoint(System::UInt64 offs); | |
67 ResultCode AddBreakpoint(System::UInt64 offs); | |
68 ResultCode RemoveBreakpoint(System::UInt64 offs); | |
69 | |
70 private: | |
71 System::String^ connectionString_; | |
72 GdbProxyImpl* pimpl_; | |
73 }; | |
74 } // namespace DebugHelpers | |
75 } // namespace NaClVsx | |
76 | |
77 | |
78 #endif // NACLVSX_DEBUGHELPERS_TRANSPORT_H_ | |
79 | |
OLD | NEW |