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_DEBUGGEE_THREAD_H_ | |
5 #define DEBUGGER_CORE_DEBUGGEE_THREAD_H_ | |
6 | |
7 #include "debugger/core/debug_event.h" | |
8 | |
9 namespace debug { | |
10 class DebugAPI; | |
11 class DebugEvent; | |
12 | |
13 /// This class represents a NaClApp thread in the debugged process. | |
14 | |
15 class DebuggeeThread { | |
16 public: | |
17 /// Creates a DebuggeeThread object with specified thread |id|, | |
18 DebuggeeThread(int id, DebugAPI* debug_api); | |
19 | |
20 int id() const { return id_; } | |
21 ProcessState state() const { return state_; } | |
22 DebugEvent last_debug_event() const { return last_debug_event_; } | |
23 | |
24 void OnDebugEvent(const DebugEvent& debug_event); | |
25 | |
26 /// Allows thread execution to continue (i.e. it calls | |
27 /// ContinueDebugEvent()). | |
28 bool Continue(); | |
29 | |
30 protected: | |
31 DebugAPI& debug_api(); | |
32 | |
33 private: | |
34 int id_; | |
35 ProcessState state_; | |
36 DebugEvent last_debug_event_; | |
37 DebugAPI* debug_api_; | |
38 | |
39 DebuggeeThread(const DebuggeeThread&); // DISALLOW_COPY_AND_ASSIGN | |
40 void operator=(const DebuggeeThread&); | |
41 }; | |
42 } // namespace debug | |
43 #endif // DEBUGGER_CORE_DEBUGGEE_THREAD_H_ | |
44 | |
OLD | NEW |