LLDB  mainline
ThreadKDP.h
Go to the documentation of this file.
1 //===-- ThreadKDP.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_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
11 
12 #include <string>
13 
14 #include "lldb/Target/Process.h"
15 #include "lldb/Target/Thread.h"
16 
17 class ProcessKDP;
18 
20 public:
22 
23  virtual ~ThreadKDP();
24 
25  void RefreshStateAfterStop() override;
26 
27  const char *GetName() override;
28 
29  const char *GetQueueName() override;
30 
31  lldb::RegisterContextSP GetRegisterContext() override;
32 
33  lldb::RegisterContextSP
35 
36  void Dump(lldb_private::Log *log, uint32_t index);
37 
38  static bool ThreadIDIsValid(lldb::tid_t thread);
39 
40  bool ShouldStop(bool &step_more);
41 
42  const char *GetBasicInfoAsString();
43 
44  void SetName(const char *name) override {
45  if (name && name[0])
46  m_thread_name.assign(name);
47  else
48  m_thread_name.clear();
49  }
50 
52 
53  void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr) {
54  m_thread_dispatch_qaddr = thread_dispatch_qaddr;
55  }
56 
58  const lldb_private::DataExtractor &exc_reply_packet);
59 
60 protected:
61  friend class ProcessKDP;
62 
63  // Member variables.
67  lldb::StopInfoSP m_cached_stop_info_sp;
68  // Protected member functions.
69  bool CalculateStopInfo() override;
70 };
71 
72 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
ThreadKDP::GetQueueName
const char * GetQueueName() override
Retrieve the Queue name for the queue currently using this Thread.
Definition: ThreadKDP.cpp:58
ThreadKDP::SetName
void SetName(const char *name) override
Definition: ThreadKDP.h:44
ProcessKDP
Definition: ProcessKDP.h:30
lldb_private::Process
Definition: Process.h:342
ThreadKDP::GetRegisterContext
lldb::RegisterContextSP GetRegisterContext() override
Definition: ThreadKDP.cpp:80
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
ThreadKDP::Dump
void Dump(lldb_private::Log *log, uint32_t index)
Definition: ThreadKDP.cpp:77
Process.h
ThreadKDP::m_thread_dispatch_qaddr
lldb::addr_t m_thread_dispatch_qaddr
Definition: ThreadKDP.h:66
ThreadKDP::SetStopInfoFrom_KDP_EXCEPTION
void SetStopInfoFrom_KDP_EXCEPTION(const lldb_private::DataExtractor &exc_reply_packet)
Definition: ThreadKDP.cpp:139
lldb_private::DataExtractor
Definition: DataExtractor.h:48
ThreadKDP::SetThreadDispatchQAddr
void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr)
Definition: ThreadKDP.h:53
lldb_private::Thread
Definition: Thread.h:62
ThreadKDP::GetBasicInfoAsString
const char * GetBasicInfoAsString()
ThreadKDP::GetThreadDispatchQAddr
lldb::addr_t GetThreadDispatchQAddr()
Definition: ThreadKDP.h:51
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
Thread.h
ThreadKDP::CreateRegisterContextForFrame
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Definition: ThreadKDP.cpp:87
ThreadKDP
Definition: ThreadKDP.h:19
ThreadKDP::ThreadIDIsValid
static bool ThreadIDIsValid(lldb::tid_t thread)
Definition: ThreadKDP.cpp:75
ThreadKDP::m_dispatch_queue_name
std::string m_dispatch_queue_name
Definition: ThreadKDP.h:65
uint32_t
ThreadKDP::m_cached_stop_info_sp
lldb::StopInfoSP m_cached_stop_info_sp
Definition: ThreadKDP.h:67
ThreadKDP::CalculateStopInfo
bool CalculateStopInfo() override
Definition: ThreadKDP.cpp:126
ThreadKDP::m_thread_name
std::string m_thread_name
Definition: ThreadKDP.h:64
ThreadKDP::ThreadKDP
ThreadKDP(lldb_private::Process &process, lldb::tid_t tid)
Definition: ThreadKDP.cpp:39
ThreadKDP::GetName
const char * GetName() override
Definition: ThreadKDP.cpp:52
lldb_private::Log
Definition: Log.h:49
ThreadKDP::~ThreadKDP
virtual ~ThreadKDP()
Definition: ThreadKDP.cpp:46
ThreadKDP::RefreshStateAfterStop
void RefreshStateAfterStop() override
Definition: ThreadKDP.cpp:60
lldb_private::StackFrame
Definition: StackFrame.h:40
ThreadKDP::ShouldStop
bool ShouldStop(bool &step_more)
Definition: ThreadKDP.cpp:79
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86