LLDB  mainline
ThreadMachCore.h
Go to the documentation of this file.
1 //===-- ThreadMachCore.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_MACH_CORE_THREADMACHCORE_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
11 
12 #include <string>
13 
14 #include "lldb/Target/Thread.h"
15 
16 class ProcessMachCore;
17 
19 public:
21 
22  ~ThreadMachCore() override;
23 
24  void RefreshStateAfterStop() override;
25 
26  const char *GetName() override;
27 
28  lldb::RegisterContextSP GetRegisterContext() override;
29 
30  lldb::RegisterContextSP
32 
33  static bool ThreadIDIsValid(lldb::tid_t thread);
34 
35  bool ShouldStop(bool &step_more);
36 
37  const char *GetBasicInfoAsString();
38 
39  void SetName(const char *name) override {
40  if (name && name[0])
41  m_thread_name.assign(name);
42  else
43  m_thread_name.clear();
44  }
45 
47 
48  void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr) {
49  m_thread_dispatch_qaddr = thread_dispatch_qaddr;
50  }
51 
52 protected:
53  friend class ProcessMachCore;
54 
55  // Member variables.
59  lldb::RegisterContextSP m_thread_reg_ctx_sp;
60 
61  // Protected member functions.
62  bool CalculateStopInfo() override;
63 };
64 
65 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
ThreadMachCore
Definition: ThreadMachCore.h:18
ThreadMachCore::RefreshStateAfterStop
void RefreshStateAfterStop() override
Definition: ThreadMachCore.cpp:48
ThreadMachCore::GetThreadDispatchQAddr
lldb::addr_t GetThreadDispatchQAddr()
Definition: ThreadMachCore.h:46
ThreadMachCore::GetRegisterContext
lldb::RegisterContextSP GetRegisterContext() override
Definition: ThreadMachCore.cpp:63
lldb_private::Process
Definition: Process.h:341
ThreadMachCore::m_dispatch_queue_name
std::string m_dispatch_queue_name
Definition: ThreadMachCore.h:57
ThreadMachCore::GetBasicInfoAsString
const char * GetBasicInfoAsString()
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
ThreadMachCore::SetName
void SetName(const char *name) override
Definition: ThreadMachCore.h:39
ThreadMachCore::ThreadMachCore
ThreadMachCore(lldb_private::Process &process, lldb::tid_t tid)
Definition: ThreadMachCore.cpp:36
ThreadMachCore::~ThreadMachCore
~ThreadMachCore() override
Definition: ThreadMachCore.cpp:40
ProcessMachCore
Definition: ProcessMachCore.h:21
lldb_private::Thread
Definition: Thread.h:60
ThreadMachCore::GetName
const char * GetName() override
Definition: ThreadMachCore.cpp:42
ThreadMachCore::m_thread_name
std::string m_thread_name
Definition: ThreadMachCore.h:56
ThreadMachCore::ThreadIDIsValid
static bool ThreadIDIsValid(lldb::tid_t thread)
Definition: ThreadMachCore.cpp:61
ThreadMachCore::m_thread_reg_ctx_sp
lldb::RegisterContextSP m_thread_reg_ctx_sp
Definition: ThreadMachCore.h:59
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
Thread.h
ThreadMachCore::CalculateStopInfo
bool CalculateStopInfo() override
Definition: ThreadMachCore.cpp:107
ThreadMachCore::SetThreadDispatchQAddr
void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr)
Definition: ThreadMachCore.h:48
ThreadMachCore::CreateRegisterContextForFrame
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Definition: ThreadMachCore.cpp:70
lldb_private::StackFrame
Definition: StackFrame.h:40
ThreadMachCore::ShouldStop
bool ShouldStop(bool &step_more)
ThreadMachCore::m_thread_dispatch_qaddr
lldb::addr_t m_thread_dispatch_qaddr
Definition: ThreadMachCore.h:58
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86