From 0641ca1a2dc2d4923ee702651aab2a9704d563b5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 17 Mar 2015 20:04:04 +0000 Subject: Remove ScriptInterpreterObject. This removes ScriptInterpreterObject from the codebase completely. Places that used to rely on ScriptInterpreterObject now use StructuredData::Object and its derived classes. To support this, a new type of StructuredData object is introduced, called StructuredData::Generic, which stores a void*. Internally within the python library, StructuredPythonObject subclasses this StructuredData::Generic class so that it can addref and decref the python object on construction and destruction. Additionally, all of the classes in PythonDataObjects.h such as PythonList, PythonDictionary, etc now provide a method to create an instance of the corresponding StructuredData type. For example, there is PythonDictionary::CreateStructuredDictionary. To eliminate dependencies on PythonDataObjects for external callers, all ScriptInterpreter methods now return only StructuredData classes The rest of the changes in this CL are focused on fixing up users of PythonDataObjects classes to use the new StructuredData classes. llvm-svn: 232534 --- .../OperatingSystem/Python/OperatingSystemPython.h | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h') diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h index 3b7dd264dc6..e29bf8054f6 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -14,11 +14,16 @@ // C Includes // C++ Includes // Other libraries and framework includes -#include "lldb/Interpreter/ScriptInterpreter.h" +#include "lldb/Core/StructuredData.h" #include "lldb/Target/OperatingSystem.h" class DynamicRegisterInfo; +namespace lldb_private +{ +class ScriptInterpreter; +} + class OperatingSystemPython : public lldb_private::OperatingSystem { public: @@ -86,15 +91,12 @@ protected: bool IsValid() const { - return m_python_object_sp && m_python_object_sp->GetObject() != NULL; + return m_python_object_sp && m_python_object_sp->IsValid(); } - - lldb::ThreadSP - CreateThreadFromThreadInfo (lldb_private::PythonDictionary &thread_dict, - lldb_private::ThreadList &core_thread_list, - lldb_private::ThreadList &old_thread_list, - std::vector &core_used_map, - bool *did_create_ptr); + + lldb::ThreadSP CreateThreadFromThreadInfo(lldb_private::StructuredData::Dictionary &thread_dict, + lldb_private::ThreadList &core_thread_list, lldb_private::ThreadList &old_thread_list, + std::vector &core_used_map, bool *did_create_ptr); DynamicRegisterInfo * GetDynamicRegisterInfo (); @@ -102,8 +104,7 @@ protected: lldb::ValueObjectSP m_thread_list_valobj_sp; std::unique_ptr m_register_info_ap; lldb_private::ScriptInterpreter *m_interpreter; - lldb::ScriptInterpreterObjectSP m_python_object_sp; - + lldb_private::StructuredData::ObjectSP m_python_object_sp; }; #endif // #ifndef liblldb_OperatingSystemPython_h_ -- cgit v1.2.3