1 //===-- ThreadKDP.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_MACOSX_KERNEL_THREADKDP_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
14 #include "lldb/Target/Process.h"
15 #include "lldb/Target/Thread.h"
19 class ThreadKDP
: public lldb_private::Thread
{
21 ThreadKDP(lldb_private::Process
&process
, lldb::tid_t tid
);
23 ~ThreadKDP() override
;
25 void RefreshStateAfterStop() override
;
27 const char *GetName() override
;
29 const char *GetQueueName() override
;
31 lldb::RegisterContextSP
GetRegisterContext() override
;
33 lldb::RegisterContextSP
34 CreateRegisterContextForFrame(lldb_private::StackFrame
*frame
) override
;
36 void Dump(lldb_private::Log
*log
, uint32_t index
);
38 static bool ThreadIDIsValid(lldb::tid_t thread
);
40 bool ShouldStop(bool &step_more
);
42 const char *GetBasicInfoAsString();
44 void SetName(const char *name
) override
{
46 m_thread_name
.assign(name
);
48 m_thread_name
.clear();
51 lldb::addr_t
GetThreadDispatchQAddr() { return m_thread_dispatch_qaddr
; }
53 void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr
) {
54 m_thread_dispatch_qaddr
= thread_dispatch_qaddr
;
57 void SetStopInfoFrom_KDP_EXCEPTION(
58 const lldb_private::DataExtractor
&exc_reply_packet
);
61 friend class ProcessKDP
;
64 std::string m_thread_name
;
65 std::string m_dispatch_queue_name
;
66 lldb::addr_t m_thread_dispatch_qaddr
;
67 lldb::StopInfoSP m_cached_stop_info_sp
;
68 // Protected member functions.
69 bool CalculateStopInfo() override
;
72 #endif // LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H