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"
19 namespace lldb_private {
20 namespace process_netbsd {
22 class NativeProcessNetBSD;
24 class NativeThreadNetBSD : public NativeThreadProtocol {
25 friend class NativeProcessNetBSD;
28 NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid);
30 // ---------------------------------------------------------------------
31 // NativeThreadProtocol Interface
32 // ---------------------------------------------------------------------
33 std::string GetName() override;
35 lldb::StateType GetState() override;
37 bool GetStopReason(ThreadStopInfo &stop_info,
38 std::string &description) override;
40 NativeRegisterContext& GetRegisterContext() override;
42 Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
43 bool hardware) override;
45 Status RemoveWatchpoint(lldb::addr_t addr) override;
47 Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
49 Status RemoveHardwareBreakpoint(lldb::addr_t addr) override;
52 // ---------------------------------------------------------------------
53 // Interface for friend classes
54 // ---------------------------------------------------------------------
56 void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
57 void SetStoppedByBreakpoint();
58 void SetStoppedByTrace();
59 void SetStoppedByExec();
60 void SetStoppedByWatchpoint(uint32_t wp_index);
65 // ---------------------------------------------------------------------
67 // ---------------------------------------------------------------------
68 lldb::StateType m_state;
69 ThreadStopInfo m_stop_info;
70 std::unique_ptr<NativeRegisterContext> m_reg_context_up;
71 std::string m_stop_description;
72 using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
73 WatchpointIndexMap m_watchpoint_index_map;
74 WatchpointIndexMap m_hw_break_index_map;
77 typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;
78 } // namespace process_netbsd
79 } // namespace lldb_private
81 #endif // #ifndef liblldb_NativeThreadNetBSD_H_