LLDB mainline
NativeThreadProtocol.h
Go to the documentation of this file.
1//===-- NativeThreadProtocol.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 LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
10#define LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
11
12#include <memory>
13#include <string>
14
15#include "lldb/Host/Debug.h"
18#include "lldb/lldb-types.h"
19
20#include "llvm/Support/Error.h"
21#include "llvm/Support/MemoryBuffer.h"
22
23namespace lldb_private {
24// NativeThreadProtocol
26public:
28
29 virtual ~NativeThreadProtocol() = default;
30
31 virtual std::string GetName() = 0;
32
34
36
37 virtual bool GetStopReason(ThreadStopInfo &stop_info,
38 std::string &description) = 0;
39
40 lldb::tid_t GetID() const { return m_tid; }
41
43
44 // Thread-specific watchpoints
45 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
46 uint32_t watch_flags, bool hardware) = 0;
47
49
50 // Thread-specific Hardware Breakpoint routines
51 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
52
54
55 virtual llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
56 GetSiginfo() const {
57 return llvm::make_error<UnimplementedError>();
58 }
59
60protected:
65
69 std::string m_stop_description;
70};
71}
72
73#endif // LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size)=0
virtual bool GetStopReason(ThreadStopInfo &stop_info, std::string &description)=0
virtual lldb::StateType GetState()=0
virtual Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware)=0
virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr)=0
virtual ~NativeThreadProtocol()=default
virtual llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo() const
virtual Status RemoveWatchpoint(lldb::addr_t addr)=0
NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid)
virtual std::string GetName()=0
virtual NativeRegisterContext & GetRegisterContext()=0
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
StateType
Process and Thread States.
uint64_t addr_t
Definition lldb-types.h:80
uint64_t tid_t
Definition lldb-types.h:84