[Lldb-commits] [PATCH] Delete ScriptInterpreterObject

Zachary Turner zturner at google.com
Fri Mar 6 14:34:54 PST 2015


Hi clayborg,

This is some preliminary work as discussed in the previous patch to get Python to be able to properly be split from the rest of the code.

This patch completely deletes ScriptInterpreterObject, and instead coverts ScriptInterpreter and ScriptInterpreterPython to use objects in StructuredData instead.  To support this, a new category of StructuredData object is created, a "Generic" category which holds a void*.  In PythonDataObjects, we then create a subclass of StructuredData::Generic called StructuredPythonObject whose job is just to Addref and Decref the void* on construction and destruction.

All methods in ScriptInterpreterPython now return StructuredData objects instead of PythonDictionary, PythonList, etc.  To support this, the various PythonDataObject classes contain methods to convert them the corresponding StructuredData types.  So the Python methods behave as normal, but instead of returning a PythonObject directly, they just convert first.

The only tricky part of this was with container types like PythonList and PythonDictionary.  For this, we had to convert the contained elements *and* the container itself, since a client won't be able to use a StructuredList whose members are PythonList void*s, for example.

The rest of the code in this patch is just fixup stuff to get things compiling with StructuredData objects instead of Python objects.

Tested on Windows and Linux, no regressions.  Will test on Mac when I can, but my machine is having technical difficulties.  But since I didn't see any issues on Linux, I don't expect anything serious.

One thing I'm not sure of is how to test OperatingSystemPython and DynamicRegisterInfo.  I don't really know what these are or how they're used.  Are there tests for these things in-tree?  Should I expect that if all the linux tests pass, that these are ok?

http://reviews.llvm.org/D8128

Files:
  include/lldb/Core/StructuredData.h
  include/lldb/DataFormatters/TypeSummary.h
  include/lldb/DataFormatters/TypeSynthetic.h
  include/lldb/Interpreter/PythonDataObjects.h
  include/lldb/Interpreter/ScriptInterpreter.h
  include/lldb/Interpreter/ScriptInterpreterPython.h
  include/lldb/Target/ThreadPlanPython.h
  include/lldb/lldb-forward.h
  source/Core/StructuredData.cpp
  source/DataFormatters/TypeSynthetic.cpp
  source/Interpreter/PythonDataObjects.cpp
  source/Interpreter/ScriptInterpreterPython.cpp
  source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
  source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
  source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  source/Plugins/Process/Utility/DynamicRegisterInfo.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  source/Target/ThreadPlanPython.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8128.21397.patch
Type: text/x-patch
Size: 125548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150306/17bd9086/attachment.bin>


More information about the lldb-commits mailing list