Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:48

0001 //===-- NativeThreadProtocol.h ----------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
0010 #define LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
0011 
0012 #include <memory>
0013 
0014 #include "lldb/Host/Debug.h"
0015 #include "lldb/Utility/UnimplementedError.h"
0016 #include "lldb/lldb-private-forward.h"
0017 #include "lldb/lldb-types.h"
0018 
0019 #include "llvm/Support/Error.h"
0020 #include "llvm/Support/MemoryBuffer.h"
0021 
0022 namespace lldb_private {
0023 // NativeThreadProtocol
0024 class NativeThreadProtocol {
0025 public:
0026   NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
0027 
0028   virtual ~NativeThreadProtocol() = default;
0029 
0030   virtual std::string GetName() = 0;
0031 
0032   virtual lldb::StateType GetState() = 0;
0033 
0034   virtual NativeRegisterContext &GetRegisterContext() = 0;
0035 
0036   virtual bool GetStopReason(ThreadStopInfo &stop_info,
0037                              std::string &description) = 0;
0038 
0039   lldb::tid_t GetID() const { return m_tid; }
0040 
0041   NativeProcessProtocol &GetProcess() { return m_process; }
0042 
0043   // Thread-specific watchpoints
0044   virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
0045                                uint32_t watch_flags, bool hardware) = 0;
0046 
0047   virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
0048 
0049   // Thread-specific Hardware Breakpoint routines
0050   virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
0051 
0052   virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
0053 
0054   virtual llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
0055   GetSiginfo() const {
0056     return llvm::make_error<UnimplementedError>();
0057   }
0058 
0059 protected:
0060   NativeProcessProtocol &m_process;
0061   lldb::tid_t m_tid;
0062 };
0063 }
0064 
0065 #endif // LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H