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
17class ProcessKDP;
18
20public:
22
23 ~ThreadKDP() override;
24
25 void RefreshStateAfterStop() override;
26
27 const char *GetName() override;
28
29 const char *GetQueueName() override;
30
32
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
60protected:
61 friend class ProcessKDP;
62
63 // Member variables.
64 std::string m_thread_name;
68 // Protected member functions.
69 bool CalculateStopInfo() override;
70};
71
72#endif // LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
void SetName(const char *name) override
Definition: ThreadKDP.h:44
std::string m_dispatch_queue_name
Definition: ThreadKDP.h:65
bool ShouldStop(bool &step_more)
Definition: ThreadKDP.cpp:79
lldb::RegisterContextSP GetRegisterContext() override
Definition: ThreadKDP.cpp:80
const char * GetQueueName() override
Retrieve the Queue name for the queue currently using this Thread.
Definition: ThreadKDP.cpp:58
~ThreadKDP() override
Definition: ThreadKDP.cpp:46
lldb::StopInfoSP m_cached_stop_info_sp
Definition: ThreadKDP.h:67
lldb::addr_t GetThreadDispatchQAddr()
Definition: ThreadKDP.h:51
void Dump(lldb_private::Log *log, uint32_t index)
Definition: ThreadKDP.cpp:77
void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr)
Definition: ThreadKDP.h:53
std::string m_thread_name
Definition: ThreadKDP.h:64
void RefreshStateAfterStop() override
Definition: ThreadKDP.cpp:60
lldb::addr_t m_thread_dispatch_qaddr
Definition: ThreadKDP.h:66
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Definition: ThreadKDP.cpp:87
static bool ThreadIDIsValid(lldb::tid_t thread)
Definition: ThreadKDP.cpp:75
const char * GetBasicInfoAsString()
void SetStopInfoFrom_KDP_EXCEPTION(const lldb_private::DataExtractor &exc_reply_packet)
Definition: ThreadKDP.cpp:139
const char * GetName() override
Definition: ThreadKDP.cpp:52
bool CalculateStopInfo() override
Ask the thread subclass to set its stop info.
Definition: ThreadKDP.cpp:126
An data extractor class.
Definition: DataExtractor.h:48
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
This base class provides an interface to stack frames.
Definition: StackFrame.h:43
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
Definition: lldb-forward.h:426
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:391
uint64_t tid_t
Definition: lldb-types.h:84