LLDB mainline
OperatingSystemPython.h
Go to the documentation of this file.
1//===-- OperatingSystemPython.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 liblldb_OperatingSystemPython_h_
10#define liblldb_OperatingSystemPython_h_
11
12#include "lldb/Host/Config.h"
13
14#if LLDB_ENABLE_PYTHON
15
19
20namespace lldb_private {
21class ScriptInterpreter;
22}
23
24class OperatingSystemPython : public lldb_private::OperatingSystem {
25public:
26 OperatingSystemPython(lldb_private::Process *process,
27 const lldb_private::FileSpec &python_module_path);
28
29 ~OperatingSystemPython() override;
30
31 // Static Functions
33 CreateInstance(lldb_private::Process *process, bool force);
34
35 static void Initialize();
36
37 static void Terminate();
38
39 static llvm::StringRef GetPluginNameStatic() { return "python"; }
40
41 static llvm::StringRef GetPluginDescriptionStatic();
42
43 // lldb_private::PluginInterface Methods
44 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
45
46 // lldb_private::OperatingSystem Methods
47 bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,
48 lldb_private::ThreadList &real_thread_list,
49 lldb_private::ThreadList &new_thread_list) override;
50
51 void ThreadWasSelected(lldb_private::Thread *thread) override;
52
55 lldb::addr_t reg_data_addr) override;
56
59
60 // Method for lazy creation of threads on demand
62
63protected:
64 bool IsValid() const {
65 return m_script_object_sp && m_script_object_sp->IsValid();
66 }
67
68 lldb::ThreadSP CreateThreadFromThreadInfo(
70 lldb_private::ThreadList &core_thread_list,
71 lldb_private::ThreadList &old_thread_list,
72 std::vector<bool> &core_used_map, bool *did_create_ptr);
73
74 lldb_private::DynamicRegisterInfo *GetDynamicRegisterInfo();
75
76 lldb::ValueObjectSP m_thread_list_valobj_sp;
77 std::unique_ptr<lldb_private::DynamicRegisterInfo> m_register_info_up;
78 lldb_private::ScriptInterpreter *m_interpreter = nullptr;
79 lldb::OperatingSystemInterfaceSP m_operating_system_interface_sp = nullptr;
80 lldb_private::StructuredData::GenericSP m_script_object_sp = nullptr;
81};
82
83#endif // LLDB_ENABLE_PYTHON
84
85#endif // liblldb_OperatingSystemPython_h_
A file utility class.
Definition: FileSpec.h:56
A plug-in interface definition class for halted OS helpers.
virtual lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context)
virtual lldb::RegisterContextSP CreateRegisterContextForThread(Thread *thread, lldb::addr_t reg_data_addr)=0
virtual bool UpdateThreadList(ThreadList &old_thread_list, ThreadList &real_thread_list, ThreadList &new_thread_list)=0
virtual lldb::StopInfoSP CreateThreadStopReason(Thread *thread)=0
virtual void ThreadWasSelected(Thread *thread)=0
virtual llvm::StringRef GetPluginName()=0
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
std::shared_ptr< Generic > GenericSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition: lldb-forward.h:446
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:480
std::shared_ptr< lldb_private::OperatingSystemInterface > OperatingSystemInterfaceSP
Definition: lldb-forward.h:381
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
Definition: lldb-forward.h:427
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:392
uint64_t tid_t
Definition: lldb-types.h:84