Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
39654 views
//===-- NativeThreadNetBSD.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_NativeThreadNetBSD_H_9#define liblldb_NativeThreadNetBSD_H_1011#include "lldb/Host/common/NativeThreadProtocol.h"1213#include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"1415#include <csignal>16#include <map>17#include <string>1819namespace lldb_private {20namespace process_netbsd {2122class NativeProcessNetBSD;2324class NativeThreadNetBSD : public NativeThreadProtocol {25friend class NativeProcessNetBSD;2627public:28NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid);2930// NativeThreadProtocol Interface31std::string GetName() override;3233lldb::StateType GetState() override;3435bool GetStopReason(ThreadStopInfo &stop_info,36std::string &description) override;3738NativeRegisterContextNetBSD &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;4849private:50// Interface for friend classes5152Status Resume();53Status SingleStep();54Status Suspend();5556void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);57void SetStoppedByBreakpoint();58void SetStoppedByTrace();59void SetStoppedByExec();60void SetStoppedByWatchpoint(uint32_t wp_index);61void SetStoppedByFork(lldb::pid_t child_pid, lldb::tid_t child_tid);62void SetStoppedByVFork(lldb::pid_t child_pid, lldb::tid_t child_tid);63void SetStoppedByVForkDone();64void SetStoppedWithNoReason();65void SetStopped();66void SetRunning();67void SetStepping();6869llvm::Error CopyWatchpointsFrom(NativeThreadNetBSD& source);7071// Member Variables72lldb::StateType m_state;73ThreadStopInfo m_stop_info;74std::unique_ptr<NativeRegisterContextNetBSD> m_reg_context_up;75std::string m_stop_description;76using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;77WatchpointIndexMap m_watchpoint_index_map;78WatchpointIndexMap m_hw_break_index_map;79};8081typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;82} // namespace process_netbsd83} // namespace lldb_private8485#endif // #ifndef liblldb_NativeThreadNetBSD_H_868788