LLDB  mainline
NativeThreadNetBSD.h
Go to the documentation of this file.
1 //===-- NativeThreadNetBSD.h ---------------------------------- -*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_NativeThreadNetBSD_H_
10 #define liblldb_NativeThreadNetBSD_H_
11 
13 
15 
16 #include <csignal>
17 #include <map>
18 #include <string>
19 
20 namespace lldb_private {
21 namespace process_netbsd {
22 
23 class NativeProcessNetBSD;
24 
26  friend class NativeProcessNetBSD;
27 
28 public:
30 
31  // NativeThreadProtocol Interface
32  std::string GetName() override;
33 
34  lldb::StateType GetState() override;
35 
36  bool GetStopReason(ThreadStopInfo &stop_info,
37  std::string &description) override;
38 
40 
41  Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
42  bool hardware) override;
43 
44  Status RemoveWatchpoint(lldb::addr_t addr) override;
45 
46  Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
47 
49 
50 private:
51  // Interface for friend classes
52 
53  Status Resume();
55  Status Suspend();
56 
57  void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
59  void SetStoppedByTrace();
60  void SetStoppedByExec();
61  void SetStoppedByWatchpoint(uint32_t wp_index);
62  void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid);
63  void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid);
64  void SetStoppedByVForkDone();
66  void SetStopped();
67  void SetRunning();
68  void SetStepping();
69 
71 
72  // Member Variables
75  std::unique_ptr<NativeRegisterContextNetBSD> m_reg_context_up;
77  using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
80 };
81 
82 typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;
83 } // namespace process_netbsd
84 } // namespace lldb_private
85 
86 #endif // #ifndef liblldb_NativeThreadNetBSD_H_
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByVFork
void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Definition: NativeThreadNetBSD.cpp:142
lldb_private::NativeThreadProtocol
Definition: NativeThreadProtocol.h:20
lldb_private::process_netbsd::NativeThreadNetBSD::RemoveHardwareBreakpoint
Status RemoveHardwareBreakpoint(lldb::addr_t addr) override
Definition: NativeThreadNetBSD.cpp:304
lldb_private::process_netbsd::NativeThreadNetBSD::SetRunning
void SetRunning()
Definition: NativeThreadNetBSD.cpp:170
lldb_private::process_netbsd::NativeThreadNetBSD::SetStepping
void SetStepping()
Definition: NativeThreadNetBSD.cpp:175
lldb_private::process_netbsd::NativeThreadNetBSD::GetStopReason
bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) override
Definition: NativeThreadNetBSD.cpp:226
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByWatchpoint
void SetStoppedByWatchpoint(uint32_t wp_index)
Definition: NativeThreadNetBSD.cpp:118
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::process_netbsd::NativeThreadNetBSD::RemoveWatchpoint
Status RemoveWatchpoint(lldb::addr_t addr) override
Definition: NativeThreadNetBSD.cpp:277
lldb_private::process_netbsd::NativeProcessNetBSD
Definition: NativeProcessNetBSD.h:28
lldb_private::process_netbsd::NativeThreadNetBSD::m_hw_break_index_map
WatchpointIndexMap m_hw_break_index_map
Definition: NativeThreadNetBSD.h:79
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByFork
void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Definition: NativeThreadNetBSD.cpp:133
lldb_private::process_netbsd::NativeThreadNetBSDSP
std::shared_ptr< NativeThreadNetBSD > NativeThreadNetBSDSP
Definition: NativeThreadNetBSD.h:82
lldb_private::process_netbsd::NativeThreadNetBSD::GetRegisterContext
NativeRegisterContextNetBSD & GetRegisterContext() override
Definition: NativeThreadNetBSD.cpp:256
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByTrace
void SetStoppedByTrace()
Definition: NativeThreadNetBSD.cpp:106
lldb_private::process_netbsd::NativeThreadNetBSD::CopyWatchpointsFrom
llvm::Error CopyWatchpointsFrom(NativeThreadNetBSD &source)
Definition: NativeThreadNetBSD.cpp:319
lldb_private::process_netbsd::NativeThreadNetBSD::SetWatchpoint
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
Definition: NativeThreadNetBSD.cpp:261
NativeRegisterContextNetBSD.h
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByVForkDone
void SetStoppedByVForkDone()
Definition: NativeThreadNetBSD.cpp:151
lldb_private::process_netbsd::NativeThreadNetBSD::SetHardwareBreakpoint
Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
Definition: NativeThreadNetBSD.cpp:288
lldb_private::process_netbsd::NativeThreadNetBSD::m_stop_description
std::string m_stop_description
Definition: NativeThreadNetBSD.h:76
lldb_private::process_netbsd::NativeRegisterContextNetBSD
Definition: NativeRegisterContextNetBSD.h:21
lldb_private::process_netbsd::NativeThreadNetBSD::SingleStep
Status SingleStep()
Definition: NativeThreadNetBSD.cpp:56
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::process_netbsd::NativeThreadNetBSD::NativeThreadNetBSD
NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid)
Definition: NativeThreadNetBSD.cpp:37
lldb_private::process_netbsd::NativeThreadNetBSD::Resume
Status Resume()
Definition: NativeThreadNetBSD.cpp:44
lldb_private::ThreadStopInfo
Definition: Debug.h:133
lldb_private::process_netbsd::NativeThreadNetBSD::m_reg_context_up
std::unique_ptr< NativeRegisterContextNetBSD > m_reg_context_up
Definition: NativeThreadNetBSD.h:75
lldb_private::process_netbsd::NativeThreadNetBSD
Definition: NativeThreadNetBSD.h:25
lldb_private::process_netbsd::NativeThreadNetBSD::m_watchpoint_index_map
WatchpointIndexMap m_watchpoint_index_map
Definition: NativeThreadNetBSD.h:78
lldb_private::process_netbsd::NativeThreadNetBSD::SetStopped
void SetStopped()
Definition: NativeThreadNetBSD.cpp:164
lldb_private::Status
Definition: Status.h:44
uint32_t
lldb_private::process_netbsd::NativeThreadNetBSD::Suspend
Status Suspend()
Definition: NativeThreadNetBSD.cpp:68
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedWithNoReason
void SetStoppedWithNoReason()
Definition: NativeThreadNetBSD.cpp:157
NativeThreadProtocol.h
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedBySignal
void SetStoppedBySignal(uint32_t signo, const siginfo_t *info=nullptr)
Definition: NativeThreadNetBSD.cpp:76
lldb_private::process_netbsd::NativeThreadNetBSD::GetState
lldb::StateType GetState() override
Definition: NativeThreadNetBSD.cpp:224
lldb_private::process_netbsd::NativeThreadNetBSD::m_stop_info
ThreadStopInfo m_stop_info
Definition: NativeThreadNetBSD.h:74
lldb_private::process_netbsd::NativeThreadNetBSD::m_state
lldb::StateType m_state
Definition: NativeThreadNetBSD.h:73
lldb_private::process_netbsd::NativeThreadNetBSD::WatchpointIndexMap
std::map< lldb::addr_t, uint32_t > WatchpointIndexMap
Definition: NativeThreadNetBSD.h:77
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByBreakpoint
void SetStoppedByBreakpoint()
Definition: NativeThreadNetBSD.cpp:100
lldb_private::process_netbsd::NativeThreadNetBSD::SetStoppedByExec
void SetStoppedByExec()
Definition: NativeThreadNetBSD.cpp:112
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb_private::process_netbsd::NativeThreadNetBSD::GetName
std::string GetName() override
Definition: NativeThreadNetBSD.cpp:180