[Lldb-commits] Review: Fixes for the test suite and API

Filipe Cabecinhas filcab at gmail.com
Thu May 10 06:45:33 PDT 2012


Hi all, 

My test suite was erring out (on trunk) on some tests. I tracked it and found out that swig (at least version 2.0.6, that I installed with homebrew) always converts ints and longs into PyLongObject. which will fail in any of lldb's __len__() methods, since these methods _must_ return a PyIntObject. I get an exception in  TestSBData.SBDataAPICase.test_with_dsym_and_run_command saying this: 

ERROR: test_with_dsym_and_run_command (TestSBData.SBDataAPICase)
Test the SBData APIs.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/filcab/dev/lldb-mine/test/lldbtest.py", line 376, in wrapper
return func(self, *args, **kwargs)
File "/Users/filcab/dev/lldb-mine/test/lldbtest.py", line 410, in wrapper
return func(self, *args, **kwargs)
File "/Users/filcab/dev/lldb-mine/test/python_api/sbdata/TestSBData.py", line 20, in test_with_dsym_and_run_command
self.data_api()
File "/Users/filcab/dev/lldb-mine/test/python_api/sbdata/TestSBData.py", line 235, in data_api
self.assertTrue(data2.uint64s == [1,2,3,4,5], 'read_data_helper failure: data2 == [1,2,3,4,5]')
File "/Users/filcab/dev/lldb-mine/build/Debug/LLDB.framework/Resources/Python/lldb/__init__.py", line 2198, in _read_all_uint64
return self._make_helper_uint64().all()
File "/Users/filcab/dev/lldb-mine/build/Debug/LLDB.framework/Resources/Python/lldb/__init__.py", line 2153, in all
return self[0:len(self)]
TypeError: __len__() should return an int
Config=i386-clang
----------------------------------------------------------------------




I'm attaching for review a patch that converts every __len__() return to a PyInt, which makes this test pass.
I'm also attaching for review a patch that makes SBProcess::ReadMemory accept PyLongObjects for the byteSize argument, as well as PyIntObjects.

Regards,

  Filipe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lldb-SBProcess_ReadMemory-bugfix.patch
Type: application/octet-stream
Size: 993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20120510/7e76ce03/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lldb-fix-__len__-methods.patch
Type: application/octet-stream
Size: 5083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20120510/7e76ce03/attachment-0001.obj>


More information about the lldb-commits mailing list