Path: blob/main/contrib/llvm-project/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
39638 views
//===-- OperatingSystemPython.h ---------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef liblldb_OperatingSystemPython_h_9#define liblldb_OperatingSystemPython_h_1011#include "lldb/Host/Config.h"1213#if LLDB_ENABLE_PYTHON1415#include "lldb/Target/DynamicRegisterInfo.h"16#include "lldb/Target/OperatingSystem.h"17#include "lldb/Utility/StructuredData.h"1819namespace lldb_private {20class ScriptInterpreter;21}2223class OperatingSystemPython : public lldb_private::OperatingSystem {24public:25OperatingSystemPython(lldb_private::Process *process,26const lldb_private::FileSpec &python_module_path);2728~OperatingSystemPython() override;2930// Static Functions31static lldb_private::OperatingSystem *32CreateInstance(lldb_private::Process *process, bool force);3334static void Initialize();3536static void Terminate();3738static llvm::StringRef GetPluginNameStatic() { return "python"; }3940static llvm::StringRef GetPluginDescriptionStatic();4142// lldb_private::PluginInterface Methods43llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }4445// lldb_private::OperatingSystem Methods46bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,47lldb_private::ThreadList &real_thread_list,48lldb_private::ThreadList &new_thread_list) override;4950void ThreadWasSelected(lldb_private::Thread *thread) override;5152lldb::RegisterContextSP53CreateRegisterContextForThread(lldb_private::Thread *thread,54lldb::addr_t reg_data_addr) override;5556lldb::StopInfoSP57CreateThreadStopReason(lldb_private::Thread *thread) override;5859// Method for lazy creation of threads on demand60lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override;6162protected:63bool IsValid() const {64return m_script_object_sp && m_script_object_sp->IsValid();65}6667lldb::ThreadSP CreateThreadFromThreadInfo(68lldb_private::StructuredData::Dictionary &thread_dict,69lldb_private::ThreadList &core_thread_list,70lldb_private::ThreadList &old_thread_list,71std::vector<bool> &core_used_map, bool *did_create_ptr);7273lldb_private::DynamicRegisterInfo *GetDynamicRegisterInfo();7475lldb::ValueObjectSP m_thread_list_valobj_sp;76std::unique_ptr<lldb_private::DynamicRegisterInfo> m_register_info_up;77lldb_private::ScriptInterpreter *m_interpreter = nullptr;78lldb::OperatingSystemInterfaceSP m_operating_system_interface_sp = nullptr;79lldb_private::StructuredData::GenericSP m_script_object_sp = nullptr;80};8182#endif // LLDB_ENABLE_PYTHON8384#endif // liblldb_OperatingSystemPython_h_858687