1 //===-- ThreadMachCore.h ----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
14 #include "lldb/Target/Thread.h"
16 class ProcessMachCore
;
18 class ThreadMachCore
: public lldb_private::Thread
{
20 ThreadMachCore(lldb_private::Process
&process
, lldb::tid_t tid
,
21 uint32_t objfile_lc_thread_idx
);
23 ~ThreadMachCore() override
;
25 void RefreshStateAfterStop() override
;
27 const char *GetName() override
;
29 lldb::RegisterContextSP
GetRegisterContext() override
;
31 lldb::RegisterContextSP
32 CreateRegisterContextForFrame(lldb_private::StackFrame
*frame
) override
;
34 static bool ThreadIDIsValid(lldb::tid_t thread
);
36 bool ShouldStop(bool &step_more
);
38 const char *GetBasicInfoAsString();
40 void SetName(const char *name
) override
{
42 m_thread_name
.assign(name
);
44 m_thread_name
.clear();
47 lldb::addr_t
GetThreadDispatchQAddr() { return m_thread_dispatch_qaddr
; }
49 void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr
) {
50 m_thread_dispatch_qaddr
= thread_dispatch_qaddr
;
54 friend class ProcessMachCore
;
57 std::string m_thread_name
;
58 std::string m_dispatch_queue_name
;
59 lldb::addr_t m_thread_dispatch_qaddr
;
60 lldb::RegisterContextSP m_thread_reg_ctx_sp
;
61 uint32_t m_objfile_lc_thread_idx
;
63 // Protected member functions.
64 bool CalculateStopInfo() override
;
67 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H