Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeThreadFreeBSD.h
39644 views
//===-- NativeThreadFreeBSD.h --------------------------------- -*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef liblldb_NativeThreadFreeBSD_H_9#define liblldb_NativeThreadFreeBSD_H_1011#include "lldb/Host/common/NativeThreadProtocol.h"1213#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"1415#include <csignal>16#include <map>17#include <string>1819namespace lldb_private {20namespace process_freebsd {2122class NativeProcessFreeBSD;2324class NativeThreadFreeBSD : public NativeThreadProtocol {25friend class NativeProcessFreeBSD;2627public:28NativeThreadFreeBSD(NativeProcessFreeBSD &process, lldb::tid_t tid);2930// NativeThreadProtocol Interface31std::string GetName() override;3233lldb::StateType GetState() override;3435bool GetStopReason(ThreadStopInfo &stop_info,36std::string &description) override;3738NativeRegisterContextFreeBSD &GetRegisterContext() override;3940Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,41bool hardware) override;4243Status RemoveWatchpoint(lldb::addr_t addr) override;4445Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;4647Status RemoveHardwareBreakpoint(lldb::addr_t addr) override;4849NativeProcessFreeBSD &GetProcess();5051llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>52GetSiginfo() const override;5354private:55// Interface for friend classes5657Status Resume();58Status SingleStep();59Status Suspend();6061void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);62void SetStoppedByBreakpoint();63void SetStoppedByTrace();64void SetStoppedByExec();65void SetStoppedByWatchpoint(uint32_t wp_index);66void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid);67void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid);68void SetStoppedByVForkDone();69void SetStoppedWithNoReason();70void SetStopped();71void SetRunning();72void SetStepping();7374llvm::Error CopyWatchpointsFrom(NativeThreadFreeBSD &source);7576// Member Variables77lldb::StateType m_state;78ThreadStopInfo m_stop_info;79std::unique_ptr<NativeRegisterContextFreeBSD> m_reg_context_up;80std::string m_stop_description;81using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;82WatchpointIndexMap m_watchpoint_index_map;83WatchpointIndexMap m_hw_break_index_map;84};8586typedef std::shared_ptr<NativeThreadFreeBSD> NativeThreadFreeBSDSP;87} // namespace process_freebsd88} // namespace lldb_private8990#endif // #ifndef liblldb_NativeThreadFreeBSD_H_919293