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

Greg Clayton gclayton at apple.com
Thu May 10 14:11:53 PDT 2012


We currently have:

SWIG Version 1.3.40


On May 10, 2012, at 12:43 PM, Filipe Cabecinhas wrote:

> Okay, I'll do that when I get home. Do you have more specific version requirements?
> 
> Regards,
> 
>   Filipe
> 
> -- 
> Filipe Cabecinhas
> Sent with Sparrow
> 
> On Thursday, 10 de May de 2012 at 18:51, Johnny Chen wrote:
> 
>> Hi Filipe,
>> 
>> Can you try 1.3-ish swig to see whether your patch is backward compatible?
>> 
>> On May 10, 2012, at 6:45 AM, Filipe Cabecinhas <filcab at gmail.com> wrote:
>> 
>>> 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
>>> 
>>> <lldb-SBProcess_ReadMemory-bugfix.patch><lldb-fix-__len__-methods.patch>_______________________________________________
>>> lldb-commits mailing list
>>> lldb-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list