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.
56  std::string m_thread_name;
57  std::string m_dispatch_queue_name;
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
lldb::addr_t m_thread_dispatch_qaddr
bool CalculateStopInfo() override
static bool ThreadIDIsValid(lldb::tid_t thread)
ThreadMachCore(lldb_private::Process &process, lldb::tid_t tid)
lldb::RegisterContextSP m_thread_reg_ctx_sp
std::string m_thread_name
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
const char * GetBasicInfoAsString()
lldb::RegisterContextSP GetRegisterContext() override
void SetName(const char *name) override
uint64_t tid_t
Definition: lldb-types.h:86
A plug-in interface definition class for debugging a process.
Definition: Process.h:362
void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr)
lldb::addr_t GetThreadDispatchQAddr()
uint64_t addr_t
Definition: lldb-types.h:83
~ThreadMachCore() override
std::string m_dispatch_queue_name
void RefreshStateAfterStop() override
const char * GetName() override
bool ShouldStop(bool &step_more)
This base class provides an interface to stack frames.
Definition: StackFrame.h:40