OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 #ifndef DEBUGGER_CORE_DEBUG_EVENT_H_ | |
5 #define DEBUGGER_CORE_DEBUG_EVENT_H_ | |
6 #include <windows.h> | |
7 #include <string> | |
8 | |
9 namespace debug { | |
10 /// Class that receives information about the debugging event. | |
11 /// It's basically an extension to Windows DEBUG_EVENT, with | |
12 /// NaCl events added. | |
13 /// For example, Windows OUTPUT_DEBUG_STRING_EVENT event can | |
14 /// carry information about NaCl untrusted thread to be started. | |
15 /// | |
16 /// Link to Windows documentation: | |
17 /// http://msdn.microsoft.com/en-us/library/ms681423%28v=VS.85%29.aspx | |
18 class DebugEvent { | |
19 public: | |
20 enum NaClDebugEventCode { | |
21 kNotNaClDebugEvent = 0, | |
22 kThreadIsAboutToStart = 1 | |
23 }; | |
24 | |
25 DebugEvent(); | |
26 | |
27 bool IsBreakpoint() const; | |
28 bool IsSingleStep() const; | |
29 int GetExceptionCode() const; | |
30 void ToString(char* buff, size_t size) const; | |
31 | |
32 DEBUG_EVENT windows_debug_event() const { return windows_debug_event_; } | |
33 NaClDebugEventCode nacl_debug_event_code() const { | |
34 return nacl_debug_event_code_; | |
35 } | |
36 void set_windows_debug_event(const DEBUG_EVENT& debug_event) { | |
37 windows_debug_event_ = debug_event; | |
38 } | |
39 void set_nacl_debug_event_code(NaClDebugEventCode event_code) { | |
40 nacl_debug_event_code_ = event_code; | |
41 } | |
42 | |
43 private: | |
44 DEBUG_EVENT windows_debug_event_; | |
45 NaClDebugEventCode nacl_debug_event_code_; | |
46 }; | |
47 } // namespace debug | |
48 | |
49 #endif // DEBUGGER_CORE_DEBUG_EVENT_H_ | |
50 | |
OLD | NEW |