blob: 8d4c03549bb93b2569266fe59867e01e49812100 [file] [log] [blame]
Andrew Walbran3d2c1972020-04-07 12:24:26 +01001//===-- 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
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02009#ifndef LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
10#define LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
Andrew Walbran3d2c1972020-04-07 12:24:26 +010011
12#include <memory>
13
14#include "lldb/Host/Debug.h"
15#include "lldb/lldb-private-forward.h"
16#include "lldb/lldb-types.h"
17
18namespace lldb_private {
19// NativeThreadProtocol
20class NativeThreadProtocol {
21public:
22 NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
23
24 virtual ~NativeThreadProtocol() {}
25
26 virtual std::string GetName() = 0;
27
28 virtual lldb::StateType GetState() = 0;
29
30 virtual NativeRegisterContext &GetRegisterContext() = 0;
31
32 virtual bool GetStopReason(ThreadStopInfo &stop_info,
33 std::string &description) = 0;
34
35 lldb::tid_t GetID() const { return m_tid; }
36
37 NativeProcessProtocol &GetProcess() { return m_process; }
38
39 // Thread-specific watchpoints
40 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
41 uint32_t watch_flags, bool hardware) = 0;
42
43 virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
44
45 // Thread-specific Hardware Breakpoint routines
46 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
47
48 virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
49
50protected:
51 NativeProcessProtocol &m_process;
52 lldb::tid_t m_tid;
53};
54}
55
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020056#endif // LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H