LLDB  mainline
ScriptedThread.h
Go to the documentation of this file.
1 //===-- ScriptedThread.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_SCRIPTED_THREAD_H
10 #define LLDB_SOURCE_PLUGINS_SCRIPTED_THREAD_H
11 
12 #include <string>
13 
14 #include "ScriptedProcess.h"
15 
19 #include "lldb/Target/Thread.h"
20 
21 namespace lldb_private {
22 class ScriptedProcess;
23 }
24 
25 namespace lldb_private {
26 
28 
29 public:
31  lldb::ScriptedThreadInterfaceSP interface_sp, lldb::tid_t tid,
32  StructuredData::GenericSP script_object_sp = nullptr);
33 
34  ~ScriptedThread() override;
35 
36  static llvm::Expected<std::shared_ptr<ScriptedThread>>
37  Create(ScriptedProcess &process,
38  StructuredData::Generic *script_object = nullptr);
39 
40  lldb::RegisterContextSP GetRegisterContext() override;
41 
42  lldb::RegisterContextSP
44 
46 
47  bool CalculateStopInfo() override;
48 
49  const char *GetInfo() override { return nullptr; }
50 
51  const char *GetName() override;
52 
53  const char *GetQueueName() override;
54 
55  void WillResume(lldb::StateType resume_state) override;
56 
57  void RefreshStateAfterStop() override;
58 
59  void ClearStackFrames() override;
60 
61 private:
63  lldb::ScriptedThreadInterfaceSP GetInterface() const;
64 
65  ScriptedThread(const ScriptedThread &) = delete;
66  const ScriptedThread &operator=(const ScriptedThread &) = delete;
67 
68  std::shared_ptr<DynamicRegisterInfo> GetDynamicRegisterInfo();
69 
71  lldb::ScriptedThreadInterfaceSP m_scripted_thread_interface_sp = nullptr;
73  std::shared_ptr<DynamicRegisterInfo> m_register_info_sp = nullptr;
74 };
75 
76 } // namespace lldb_private
77 
78 #endif // LLDB_SOURCE_PLUGINS_SCRIPTED_THREAD_H
lldb_private::ScriptedThread::CheckInterpreterAndScriptObject
void CheckInterpreterAndScriptObject() const
Definition: ScriptedThread.cpp:24
lldb_private::ScriptedThread::CalculateStopInfo
bool CalculateStopInfo() override
Definition: ScriptedThread.cpp:217
lldb_private::ScriptedThread::m_register_info_sp
std::shared_ptr< DynamicRegisterInfo > m_register_info_sp
Definition: ScriptedThread.h:73
RegisterContextMemory.h
lldb_private::StructuredData::GenericSP
std::shared_ptr< Generic > GenericSP
Definition: StructuredData.h:68
lldb_private::ScriptedThread::ScriptedThread
ScriptedThread(ScriptedProcess &process, lldb::ScriptedThreadInterfaceSP interface_sp, lldb::tid_t tid, StructuredData::GenericSP script_object_sp=nullptr)
DynamicRegisterInfo.h
lldb_private::ScriptedThread::m_script_object_sp
lldb_private::StructuredData::GenericSP m_script_object_sp
Definition: ScriptedThread.h:72
lldb_private::ScriptedThread::GetName
const char * GetName() override
Definition: ScriptedThread.cpp:85
lldb_private::ScriptedThread::~ScriptedThread
~ScriptedThread() override
Definition: ScriptedThread.cpp:83
lldb_private::ScriptedThread::LoadArtificialStackFrames
bool LoadArtificialStackFrames()
Definition: ScriptedThread.cpp:150
lldb_private::ScriptedThread::ClearStackFrames
void ClearStackFrames() override
Definition: ScriptedThread.cpp:103
lldb_private::ScriptedThread::RefreshStateAfterStop
void RefreshStateAfterStop() override
Definition: ScriptedThread.cpp:284
lldb_private::ScriptedThread::GetInfo
const char * GetInfo() override
Definition: ScriptedThread.h:49
lldb_private::ScriptedThread::CreateRegisterContextForFrame
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Definition: ScriptedThread.cpp:112
ScriptedProcess.h
lldb_private::Thread
Definition: Thread.h:61
lldb_private::ScriptedThread::GetRegisterContext
lldb::RegisterContextSP GetRegisterContext() override
Definition: ScriptedThread.cpp:105
lldb_private::StructuredData::Generic
Definition: StructuredData.h:543
Thread.h
lldb_private::ScriptedThread::m_scripted_thread_interface_sp
lldb::ScriptedThreadInterfaceSP m_scripted_thread_interface_sp
Definition: ScriptedThread.h:71
lldb_private::ScriptedThread::Create
static llvm::Expected< std::shared_ptr< ScriptedThread > > Create(ScriptedProcess &process, StructuredData::Generic *script_object=nullptr)
Definition: ScriptedThread.cpp:30
lldb_private::ScriptedThread::GetInterface
lldb::ScriptedThreadInterfaceSP GetInterface() const
Definition: ScriptedThread.cpp:289
lldb_private::ScriptedThread::m_scripted_process
const ScriptedProcess & m_scripted_process
Definition: ScriptedThread.h:70
lldb_private::ScriptedThread::operator=
const ScriptedThread & operator=(const ScriptedThread &)=delete
lldb_private::ScriptedProcess
Definition: ScriptedProcess.h:22
lldb_private::ScriptedThread::WillResume
void WillResume(lldb::StateType resume_state) override
Definition: ScriptedThread.cpp:101
lldb_private::ScriptedThread::GetDynamicRegisterInfo
std::shared_ptr< DynamicRegisterInfo > GetDynamicRegisterInfo()
Definition: ScriptedThread.cpp:293
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ScriptedThread
Definition: ScriptedThread.h:27
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::ScriptedThread::GetQueueName
const char * GetQueueName() override
Retrieve the Queue name for the queue currently using this Thread.
Definition: ScriptedThread.cpp:93
lldb_private::StackFrame
Definition: StackFrame.h:40
ScriptInterpreter.h
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86