1 //===-- NativeThreadNetBSD.h ---------------------------------- -*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_NativeThreadNetBSD_H_ 11 #define liblldb_NativeThreadNetBSD_H_ 12 13 #include "lldb/Host/common/NativeThreadProtocol.h" 14 15 namespace lldb_private { 16 namespace process_netbsd { 17 18 class NativeProcessNetBSD; 19 20 class NativeThreadNetBSD : public NativeThreadProtocol { 21 friend class NativeProcessNetBSD; 22 23 public: 24 NativeThreadNetBSD(NativeProcessNetBSD *process, lldb::tid_t tid); 25 26 // --------------------------------------------------------------------- 27 // NativeThreadProtocol Interface 28 // --------------------------------------------------------------------- 29 std::string GetName() override; 30 31 lldb::StateType GetState() override; 32 33 bool GetStopReason(ThreadStopInfo &stop_info, 34 std::string &description) override; 35 36 NativeRegisterContextSP GetRegisterContext() override; 37 38 Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, 39 bool hardware) override; 40 41 Error RemoveWatchpoint(lldb::addr_t addr) override; 42 43 Error SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; 44 45 Error RemoveHardwareBreakpoint(lldb::addr_t addr) override; 46 47 private: 48 // --------------------------------------------------------------------- 49 // Interface for friend classes 50 // --------------------------------------------------------------------- 51 52 void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr); 53 void SetStoppedByBreakpoint(); 54 void SetStopped(); 55 void SetRunning(); 56 57 // --------------------------------------------------------------------- 58 // Member Variables 59 // --------------------------------------------------------------------- 60 lldb::StateType m_state; 61 ThreadStopInfo m_stop_info; 62 NativeRegisterContextSP m_reg_context_sp; 63 std::string m_stop_description; 64 }; 65 66 typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP; 67 } // namespace process_netbsd 68 } // namespace lldb_private 69 70 #endif // #ifndef liblldb_NativeThreadNetBSD_H_ 71