LLDB  mainline
NativeThreadFreeBSD.h
Go to the documentation of this file.
1 //===-- NativeThreadFreeBSD.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_NativeThreadFreeBSD_H_
10 #define liblldb_NativeThreadFreeBSD_H_
11 
13 
15 
16 #include <csignal>
17 #include <map>
18 #include <string>
19 
20 namespace lldb_private {
21 namespace process_freebsd {
22 
23 class NativeProcessFreeBSD;
24 
26  friend class NativeProcessFreeBSD;
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<NativeRegisterContextFreeBSD> m_reg_context_up;
77  using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
80 };
81 
82 typedef std::shared_ptr<NativeThreadFreeBSD> NativeThreadFreeBSDSP;
83 } // namespace process_freebsd
84 } // namespace lldb_private
85 
86 #endif // #ifndef liblldb_NativeThreadFreeBSD_H_
lldb_private::process_freebsd::NativeThreadFreeBSD::SingleStep
Status SingleStep()
Definition: NativeThreadFreeBSD.cpp:59
lldb_private::process_freebsd::NativeThreadFreeBSD::CopyWatchpointsFrom
llvm::Error CopyWatchpointsFrom(NativeThreadFreeBSD &source)
Definition: NativeThreadFreeBSD.cpp:307
lldb_private::process_freebsd::NativeThreadFreeBSDSP
std::shared_ptr< NativeThreadFreeBSD > NativeThreadFreeBSDSP
Definition: NativeThreadFreeBSD.h:82
lldb_private::process_freebsd::NativeThreadFreeBSD::NativeThreadFreeBSD
NativeThreadFreeBSD(NativeProcessFreeBSD &process, lldb::tid_t tid)
Definition: NativeThreadFreeBSD.cpp:35
lldb_private::NativeThreadProtocol
Definition: NativeThreadProtocol.h:20
lldb_private::process_freebsd::NativeThreadFreeBSD::SetHardwareBreakpoint
Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
Definition: NativeThreadFreeBSD.cpp:276
lldb_private::process_freebsd::NativeProcessFreeBSD
Definition: NativeProcessFreeBSD.h:30
lldb_private::process_freebsd::NativeThreadFreeBSD::GetState
lldb::StateType GetState() override
Definition: NativeThreadFreeBSD.cpp:212
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByFork
void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Definition: NativeThreadFreeBSD.cpp:133
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByTrace
void SetStoppedByTrace()
Definition: NativeThreadFreeBSD.cpp:106
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByVForkDone
void SetStoppedByVForkDone()
Definition: NativeThreadFreeBSD.cpp:151
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::process_freebsd::NativeThreadFreeBSD
Definition: NativeThreadFreeBSD.h:25
lldb_private::process_freebsd::NativeThreadFreeBSD::m_stop_description
std::string m_stop_description
Definition: NativeThreadFreeBSD.h:76
lldb_private::process_freebsd::NativeThreadFreeBSD::SetRunning
void SetRunning()
Definition: NativeThreadFreeBSD.cpp:170
lldb_private::process_freebsd::NativeThreadFreeBSD::GetName
std::string GetName() override
Definition: NativeThreadFreeBSD.cpp:180
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByExec
void SetStoppedByExec()
Definition: NativeThreadFreeBSD.cpp:112
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStopped
void SetStopped()
Definition: NativeThreadFreeBSD.cpp:164
lldb_private::process_freebsd::NativeThreadFreeBSD::RemoveHardwareBreakpoint
Status RemoveHardwareBreakpoint(lldb::addr_t addr) override
Definition: NativeThreadFreeBSD.cpp:292
lldb_private::process_freebsd::NativeThreadFreeBSD::Suspend
Status Suspend()
Definition: NativeThreadFreeBSD.cpp:69
lldb_private::process_freebsd::NativeThreadFreeBSD::m_reg_context_up
std::unique_ptr< NativeRegisterContextFreeBSD > m_reg_context_up
Definition: NativeThreadFreeBSD.h:75
lldb_private::process_freebsd::NativeThreadFreeBSD::RemoveWatchpoint
Status RemoveWatchpoint(lldb::addr_t addr) override
Definition: NativeThreadFreeBSD.cpp:265
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedWithNoReason
void SetStoppedWithNoReason()
Definition: NativeThreadFreeBSD.cpp:157
lldb_private::ThreadStopInfo
Definition: Debug.h:133
lldb_private::process_freebsd::NativeThreadFreeBSD::WatchpointIndexMap
std::map< lldb::addr_t, uint32_t > WatchpointIndexMap
Definition: NativeThreadFreeBSD.h:77
lldb_private::process_freebsd::NativeThreadFreeBSD::Resume
Status Resume()
Definition: NativeThreadFreeBSD.cpp:44
lldb_private::process_freebsd::NativeThreadFreeBSD::SetWatchpoint
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
Definition: NativeThreadFreeBSD.cpp:249
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByBreakpoint
void SetStoppedByBreakpoint()
Definition: NativeThreadFreeBSD.cpp:100
lldb_private::Status
Definition: Status.h:44
uint32_t
NativeThreadProtocol.h
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::process_freebsd::NativeThreadFreeBSD::GetStopReason
bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) override
Definition: NativeThreadFreeBSD.cpp:214
lldb_private::process_freebsd::NativeThreadFreeBSD::m_hw_break_index_map
WatchpointIndexMap m_hw_break_index_map
Definition: NativeThreadFreeBSD.h:79
lldb_private::process_freebsd::NativeRegisterContextFreeBSD
Definition: NativeRegisterContextFreeBSD.h:21
NativeRegisterContextFreeBSD.h
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_freebsd::NativeThreadFreeBSD::GetRegisterContext
NativeRegisterContextFreeBSD & GetRegisterContext() override
Definition: NativeThreadFreeBSD.cpp:244
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByWatchpoint
void SetStoppedByWatchpoint(uint32_t wp_index)
Definition: NativeThreadFreeBSD.cpp:118
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedBySignal
void SetStoppedBySignal(uint32_t signo, const siginfo_t *info=nullptr)
Definition: NativeThreadFreeBSD.cpp:76
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStoppedByVFork
void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Definition: NativeThreadFreeBSD.cpp:142
lldb_private::process_freebsd::NativeThreadFreeBSD::m_state
lldb::StateType m_state
Definition: NativeThreadFreeBSD.h:73
lldb_private::process_freebsd::NativeThreadFreeBSD::m_stop_info
ThreadStopInfo m_stop_info
Definition: NativeThreadFreeBSD.h:74
lldb_private::process_freebsd::NativeThreadFreeBSD::SetStepping
void SetStepping()
Definition: NativeThreadFreeBSD.cpp:175
lldb_private::process_freebsd::NativeThreadFreeBSD::m_watchpoint_index_map
WatchpointIndexMap m_watchpoint_index_map
Definition: NativeThreadFreeBSD.h:78
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86