LLDB  mainline
NativeThreadWindows.h
Go to the documentation of this file.
1 //===-- NativeThreadWindows.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 liblldb_NativeThreadWindows_h_
10 #define liblldb_NativeThreadWindows_h_
11 
12 #include "lldb/Host/HostThread.h"
15 
17 
18 namespace lldb_private {
19 
20 class NativeProcessWindows;
21 
23 public:
24  NativeThreadWindows(NativeProcessWindows &process, const HostThread &thread);
25 
27 
28  Status DoStop();
29  Status DoResume(lldb::StateType resume_state);
30 
31  std::string GetName() override;
32 
33  lldb::StateType GetState() override { return m_state; }
34 
36  return *m_reg_context_up;
37  }
38 
39  bool GetStopReason(ThreadStopInfo &stop_info,
40  std::string &description) override;
41 
42  Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
43  bool hardware) override;
44 
45  Status RemoveWatchpoint(lldb::addr_t addr) override;
46 
47  Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
48 
50 
51  void SetStopReason(ThreadStopInfo stop_info, std::string description);
52 
53  const HostThread &GetHostThread() { return m_host_thread; }
54 
55 protected:
60  std::unique_ptr<NativeRegisterContextWindows> m_reg_context_up;
61  // Cache address and index of the watchpoints and hardware breakpoints since
62  // the register context does not.
63  using IndexMap = std::map<lldb::addr_t, uint32_t>;
67 };
68 } // namespace lldb_private
69 
70 #endif // #ifndef liblldb_NativeThreadWindows_h_
lldb_private::NativeThreadWindows::SetStopReason
void SetStopReason(ThreadStopInfo stop_info, std::string description)
Definition: NativeThreadWindows.cpp:112
lldb_private::NativeThreadWindows::GetHostThread
const HostThread & GetHostThread()
Definition: NativeThreadWindows.h:53
lldb_private::NativeThreadWindows
Definition: NativeThreadWindows.h:22
lldb_private::NativeThreadProtocol
Definition: NativeThreadProtocol.h:20
lldb_private::HostThread
Definition: HostThread.h:29
lldb_private::NativeThreadWindows::SetHardwareBreakpoint
Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
Definition: NativeThreadWindows.cpp:178
lldb_private::NativeThreadWindows::DoStop
Status DoStop()
Definition: NativeThreadWindows.cpp:33
NativeRegisterContextWindows.h
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::NativeThreadWindows::GetStopReason
bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) override
Definition: NativeThreadWindows.cpp:119
lldb_private::NativeThreadWindows::m_stop_info
ThreadStopInfo m_stop_info
Definition: NativeThreadWindows.h:58
lldb_private::NativeThreadWindows::m_name
std::string m_name
Definition: NativeThreadWindows.h:57
HostThread.h
lldb-private-forward.h
lldb_private::NativeThreadWindows::m_stop_description
std::string m_stop_description
Definition: NativeThreadWindows.h:59
lldb_private::NativeThreadWindows::GetName
std::string GetName() override
Definition: NativeThreadWindows.cpp:97
lldb_private::NativeThreadWindows::m_hw_breakpoint_index_map
IndexMap m_hw_breakpoint_index_map
Definition: NativeThreadWindows.h:65
lldb_private::NativeRegisterContextWindows
Definition: NativeRegisterContextWindows.h:20
lldb_private::NativeThreadWindows::m_reg_context_up
std::unique_ptr< NativeRegisterContextWindows > m_reg_context_up
Definition: NativeThreadWindows.h:60
lldb_private::NativeThreadWindows::~NativeThreadWindows
~NativeThreadWindows()
Definition: NativeThreadWindows.h:26
lldb_private::NativeThreadWindows::IndexMap
std::map< lldb::addr_t, uint32_t > IndexMap
Definition: NativeThreadWindows.h:63
lldb_private::NativeThreadWindows::RemoveWatchpoint
Status RemoveWatchpoint(lldb::addr_t addr) override
Definition: NativeThreadWindows.cpp:167
lldb_private::NativeThreadWindows::GetRegisterContext
NativeRegisterContextWindows & GetRegisterContext() override
Definition: NativeThreadWindows.h:35
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ThreadStopInfo
Definition: Debug.h:133
lldb_private::NativeThreadWindows::m_state
lldb::StateType m_state
Definition: NativeThreadWindows.h:56
lldb_private::NativeThreadWindows::GetState
lldb::StateType GetState() override
Definition: NativeThreadWindows.h:33
lldb_private::NativeThreadWindows::NativeThreadWindows
NativeThreadWindows(NativeProcessWindows &process, const HostThread &thread)
Definition: NativeThreadWindows.cpp:24
lldb_private::Status
Definition: Status.h:44
lldb_private::NativeThreadWindows::m_watchpoint_index_map
IndexMap m_watchpoint_index_map
Definition: NativeThreadWindows.h:64
uint32_t
NativeThreadProtocol.h
lldb_private::NativeThreadWindows::SetWatchpoint
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
Definition: NativeThreadWindows.cpp:150
lldb_private::NativeThreadWindows::DoResume
Status DoResume(lldb::StateType resume_state)
Definition: NativeThreadWindows.cpp:45
lldb_private::NativeProcessWindows
Definition: NativeProcessWindows.h:30
lldb_private::NativeThreadWindows::RemoveHardwareBreakpoint
Status RemoveHardwareBreakpoint(lldb::addr_t addr) override
Definition: NativeThreadWindows.cpp:183
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::NativeThreadWindows::m_host_thread
HostThread m_host_thread
Definition: NativeThreadWindows.h:66