1 //===-- NativeThreadProtocol.h ----------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_NativeThreadProtocol_h_
10 #define liblldb_NativeThreadProtocol_h_
14 #include "lldb/Host/Debug.h"
15 #include "lldb/lldb-private-forward.h"
16 #include "lldb/lldb-types.h"
18 namespace lldb_private {
19 // NativeThreadProtocol
20 class NativeThreadProtocol {
22 NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
24 virtual ~NativeThreadProtocol() {}
26 virtual std::string GetName() = 0;
28 virtual lldb::StateType GetState() = 0;
30 virtual NativeRegisterContext &GetRegisterContext() = 0;
32 virtual bool GetStopReason(ThreadStopInfo &stop_info,
33 std::string &description) = 0;
35 lldb::tid_t GetID() const { return m_tid; }
37 NativeProcessProtocol &GetProcess() { return m_process; }
39 // Thread-specific watchpoints
40 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
41 uint32_t watch_flags, bool hardware) = 0;
43 virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
45 // Thread-specific Hardware Breakpoint routines
46 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
48 virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
51 NativeProcessProtocol &m_process;
56 #endif // #ifndef liblldb_NativeThreadProtocol_h_