Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / MacOSX-Kernel / ThreadKDP.h
blob08e007fb3f9b93281204cb22b793828ddfb2d212
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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_THREADKDP_H
12 #include <string>
14 #include "lldb/Target/Process.h"
15 #include "lldb/Target/Thread.h"
17 class ProcessKDP;
19 class ThreadKDP : public lldb_private::Thread {
20 public:
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 {
45 if (name && name[0])
46 m_thread_name.assign(name);
47 else
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);
60 protected:
61 friend class ProcessKDP;
63 // Member variables.
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