1 //===-- NativeThreadNetBSD.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_NativeThreadNetBSD_H_
11 #define liblldb_NativeThreadNetBSD_H_
13 #include "lldb/Host/common/NativeThreadProtocol.h"
18 namespace lldb_private {
19 namespace process_netbsd {
21 class NativeProcessNetBSD;
23 class NativeThreadNetBSD : public NativeThreadProtocol {
24 friend class NativeProcessNetBSD;
27 NativeThreadNetBSD(NativeProcessNetBSD *process, lldb::tid_t tid);
29 // ---------------------------------------------------------------------
30 // NativeThreadProtocol Interface
31 // ---------------------------------------------------------------------
32 std::string GetName() override;
34 lldb::StateType GetState() override;
36 bool GetStopReason(ThreadStopInfo &stop_info,
37 std::string &description) override;
39 NativeRegisterContextSP GetRegisterContext() override;
41 Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
42 bool hardware) override;
44 Error RemoveWatchpoint(lldb::addr_t addr) override;
46 Error SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
48 Error RemoveHardwareBreakpoint(lldb::addr_t addr) override;
51 // ---------------------------------------------------------------------
52 // Interface for friend classes
53 // ---------------------------------------------------------------------
55 void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
56 void SetStoppedByBreakpoint();
57 void SetStoppedByTrace();
58 void SetStoppedByExec();
59 void SetStoppedByWatchpoint(uint32_t wp_index);
64 // ---------------------------------------------------------------------
66 // ---------------------------------------------------------------------
67 lldb::StateType m_state;
68 ThreadStopInfo m_stop_info;
69 NativeRegisterContextSP m_reg_context_sp;
70 std::string m_stop_description;
71 using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
72 WatchpointIndexMap m_watchpoint_index_map;
73 WatchpointIndexMap m_hw_break_index_map;
76 typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;
77 } // namespace process_netbsd
78 } // namespace lldb_private
80 #endif // #ifndef liblldb_NativeThreadNetBSD_H_