LLDB  mainline
ThreadFreeBSDKernel.h
Go to the documentation of this file.
1 //===-- ThreadFreeBSDKernel.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_FREEBSDKERNEL_THREADFREEBSDKERNEL_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_THREADFREEBSDKERNEL_H
11 
12 #include "lldb/Target/Thread.h"
13 
15 public:
17  lldb::addr_t pcb_addr, std::string thread_name);
18 
19  ~ThreadFreeBSDKernel() override;
20 
21  void RefreshStateAfterStop() override;
22 
23  lldb::RegisterContextSP GetRegisterContext() override;
24 
25  lldb::RegisterContextSP
27 
28  const char *GetName() override {
29  if (m_thread_name.empty())
30  return nullptr;
31  return m_thread_name.c_str();
32  }
33 
34  void SetName(const char *name) override {
35  if (name && name[0])
36  m_thread_name.assign(name);
37  else
38  m_thread_name.clear();
39  }
40 
41 protected:
42  bool CalculateStopInfo() override;
43 
44 private:
46  lldb::RegisterContextSP m_thread_reg_ctx_sp;
48 };
49 
50 #endif // LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_THREADFREEBSDKERNEL_H
ThreadFreeBSDKernel
Definition: ThreadFreeBSDKernel.h:14
lldb_private::Process
Definition: Process.h:338
ThreadFreeBSDKernel::~ThreadFreeBSDKernel
~ThreadFreeBSDKernel() override
Definition: ThreadFreeBSDKernel.cpp:32
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Thread
Definition: Thread.h:61
ThreadFreeBSDKernel::m_thread_reg_ctx_sp
lldb::RegisterContextSP m_thread_reg_ctx_sp
Definition: ThreadFreeBSDKernel.h:46
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
Thread.h
ThreadFreeBSDKernel::CreateRegisterContextForFrame
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Definition: ThreadFreeBSDKernel.cpp:43
ThreadFreeBSDKernel::SetName
void SetName(const char *name) override
Definition: ThreadFreeBSDKernel.h:34
ThreadFreeBSDKernel::RefreshStateAfterStop
void RefreshStateAfterStop() override
Definition: ThreadFreeBSDKernel.cpp:34
ThreadFreeBSDKernel::GetRegisterContext
lldb::RegisterContextSP GetRegisterContext() override
Definition: ThreadFreeBSDKernel.cpp:36
ThreadFreeBSDKernel::CalculateStopInfo
bool CalculateStopInfo() override
Definition: ThreadFreeBSDKernel.cpp:86
ThreadFreeBSDKernel::GetName
const char * GetName() override
Definition: ThreadFreeBSDKernel.h:28
ThreadFreeBSDKernel::ThreadFreeBSDKernel
ThreadFreeBSDKernel(lldb_private::Process &process, lldb::tid_t tid, lldb::addr_t pcb_addr, std::string thread_name)
Definition: ThreadFreeBSDKernel.cpp:26
lldb_private::StackFrame
Definition: StackFrame.h:40
ThreadFreeBSDKernel::m_thread_name
std::string m_thread_name
Definition: ThreadFreeBSDKernel.h:45
ThreadFreeBSDKernel::m_pcb_addr
lldb::addr_t m_pcb_addr
Definition: ThreadFreeBSDKernel.h:47
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86