Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / mach-core / ThreadMachCore.h
blob26c4e567443c14795d020dac529a021692a175f2
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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_THREADMACHCORE_H
12 #include <string>
14 #include "lldb/Target/Thread.h"
16 class ProcessMachCore;
18 class ThreadMachCore : public lldb_private::Thread {
19 public:
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 {
41 if (name && name[0])
42 m_thread_name.assign(name);
43 else
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;
53 protected:
54 friend class ProcessMachCore;
56 // Member variables.
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