1 //===-- NativeThreadProtocol.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_NativeThreadProtocol_h_
11 #define liblldb_NativeThreadProtocol_h_
15 #include "lldb/Host/Debug.h"
16 #include "lldb/lldb-private-forward.h"
17 #include "lldb/lldb-types.h"
19 namespace lldb_private {
20 //------------------------------------------------------------------
21 // NativeThreadProtocol
22 //------------------------------------------------------------------
23 class NativeThreadProtocol {
25 NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
27 virtual ~NativeThreadProtocol() {}
29 virtual std::string GetName() = 0;
31 virtual lldb::StateType GetState() = 0;
33 virtual NativeRegisterContext &GetRegisterContext() = 0;
35 virtual bool GetStopReason(ThreadStopInfo &stop_info,
36 std::string &description) = 0;
38 lldb::tid_t GetID() const { return m_tid; }
40 NativeProcessProtocol &GetProcess() { return m_process; }
42 // ---------------------------------------------------------------------
43 // Thread-specific watchpoints
44 // ---------------------------------------------------------------------
45 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
46 uint32_t watch_flags, bool hardware) = 0;
48 virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
50 // ---------------------------------------------------------------------
51 // Thread-specific Hardware Breakpoint routines
52 // ---------------------------------------------------------------------
53 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
55 virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
58 NativeProcessProtocol &m_process;
63 #endif // #ifndef liblldb_NativeThreadProtocol_h_