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"
19#include "lldb/lldb-types.h"
20
21#include "llvm/Support/Error.h"
22#include "llvm/Support/MemoryBuffer.h"
23
24namespace lldb_private {
25// NativeThreadProtocol
27public:
29
30 virtual ~NativeThreadProtocol() = default;
31
32 virtual std::string GetName() = 0;
33
35
37
38 virtual bool GetStopReason(ThreadStopInfo &stop_info,
39 std::string &description) = 0;
40
41 lldb::tid_t GetID() const { return m_tid; }
42
44
45 // Thread-specific watchpoints
46 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
47 uint32_t watch_flags, bool hardware) = 0;
48
50
51 // Thread-specific Hardware Breakpoint routines
52 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
53
55
56 virtual llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
57 GetSiginfo() const {
58 return llvm::make_error<UnimplementedError>();
59 }
60
61 virtual StructuredData::ObjectSP GetExtendedInfo() const { return nullptr; }
62
63protected:
68
72 std::string m_stop_description;
73};
74}
75
76#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
virtual StructuredData::ObjectSP GetExtendedInfo() const
NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid)
virtual std::string GetName()=0
virtual NativeRegisterContext & GetRegisterContext()=0
An error handling class.
Definition Status.h:118
std::shared_ptr< Object > ObjectSP
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:85