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
20namespace lldb_private {
21namespace process_freebsd {
22
23class NativeProcessFreeBSD;
24
27
28public:
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
45
46 Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
47
49
50 llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
51 GetSiginfo() const override;
52
53private:
54 // Interface for friend classes
55
56 Status Resume();
59
60 void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
62 void SetStoppedByTrace();
63 void SetStoppedByExec();
64 void SetStoppedByWatchpoint(uint32_t wp_index);
65 void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid);
66 void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid);
69 void SetStopped();
70 void SetRunning();
71 void SetStepping();
72
73 llvm::Error CopyWatchpointsFrom(NativeThreadFreeBSD &source);
74
75 // Member Variables
78 std::unique_ptr<NativeRegisterContextFreeBSD> m_reg_context_up;
79 std::string m_stop_description;
80 using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
83};
84
85typedef std::shared_ptr<NativeThreadFreeBSD> NativeThreadFreeBSDSP;
86} // namespace process_freebsd
87} // namespace lldb_private
88
89#endif // #ifndef liblldb_NativeThreadFreeBSD_H_
An error handling class.
Definition: Status.h:44
Manages communication with the inferior (debugee) process.
std::map< lldb::addr_t, uint32_t > WatchpointIndexMap
Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo() const override
NativeRegisterContextFreeBSD & GetRegisterContext() override
llvm::Error CopyWatchpointsFrom(NativeThreadFreeBSD &source)
std::unique_ptr< NativeRegisterContextFreeBSD > m_reg_context_up
void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
void SetStoppedBySignal(uint32_t signo, const siginfo_t *info=nullptr)
bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) override
Status RemoveHardwareBreakpoint(lldb::addr_t addr) override
std::shared_ptr< NativeThreadFreeBSD > NativeThreadFreeBSDSP
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
StateType
Process and Thread States.
uint64_t pid_t
Definition: lldb-types.h:81
uint64_t addr_t
Definition: lldb-types.h:79
uint64_t tid_t
Definition: lldb-types.h:82