modify-python-lldb.py: clean up __iter__ and __len__ support
authorPavel Labath <pavel@labath.sk>
Wed, 3 Apr 2019 11:48:38 +0000 (11:48 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 3 Apr 2019 11:48:38 +0000 (11:48 +0000)
commit4da5a1dbab579da5975de573719c50fd3c1faeab
treeebf2ba238469a703f9ab0aef2f3cb4c98b9f1d21
parent02599de2e1e9688ed74e2d1080c4e4f73c6072af
modify-python-lldb.py: clean up __iter__ and __len__ support

Summary:
Instead of modifying the swig-generated code, just add the appropriate
methods to the interface files in order to get the swig to do the
generation for us.

This is a straight-forward move from the python script to the interface
files. The single class which has nontrivial handling in the script
(SBModule) has been left for a separate patch.

For the cases where I did not find any tests exercising the
iteration/length methods (i.e., no tests failed after I stopped emitting
them), I tried to add basic tests for that functionality.

Reviewers: zturner, jingham, amccarth

Subscribers: jdoerfert, lldb-commits

Differential Revision: https://reviews.llvm.org/D60119

llvm-svn: 357572
20 files changed:
lldb/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py
lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py
lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py
lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py
lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py
lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
lldb/scripts/Python/modify-python-lldb.py
lldb/scripts/interface/SBBreakpoint.i
lldb/scripts/interface/SBCompileUnit.i
lldb/scripts/interface/SBDebugger.i
lldb/scripts/interface/SBInstructionList.i
lldb/scripts/interface/SBProcess.i
lldb/scripts/interface/SBSection.i
lldb/scripts/interface/SBStringList.i
lldb/scripts/interface/SBSymbolContextList.i
lldb/scripts/interface/SBTarget.i
lldb/scripts/interface/SBThread.i
lldb/scripts/interface/SBType.i
lldb/scripts/interface/SBValue.i
lldb/scripts/interface/SBValueList.i