[PING][PATCH v9] Add pretty printers for the NPTL lock types
Stefan Liebler
stli@linux.vnet.ibm.com
Tue Jul 12 07:53:00 GMT 2016
On 07/11/2016 06:11 PM, Martin Galvan wrote:
> Hi all! Before I forget, in the future please CC me directly because
> sometimes I miss the mailing list digests. Thanks!
>
> On Mon, Jul 11, 2016 at 12:00 PM, Siddhesh Poyarekar
> <siddhesh@sourceware.org> wrote:
>> On Mon, Jul 11, 2016 at 03:16:19PM +0200, Stefan Liebler wrote:
>>> On that machine, I have installed python-pexpect-3.1-1.fc20.noarch.
>>> I've tried python2-pexpect-4.0.1-4.fc23.noarch on another machine and you
>>> are right, the "echo=False" issue does not appear.
>>>
>>> But I get fails:
>>> FAIL: pretty-printers/test-condvar-attributes-pp:
>>> Error: Response does not match the expected pattern.
>>> Command: print *attr
>>> Expected pattern: pthread_condattr_t
>>> Response: Python Exception <class 'gdb.error'> No struct type named
>>> pthread_condattr.:
>>>
>>> Python Exception <class 'gdb.error'> No struct type named pthread_condattr.:
>>>
>>> $3 = {__size = "\000\000\000", __align = 0}
>> <snip>
>>> The gdb version is gdb-7.10.1-30.fc23.s390x.
>>
>> That's odd, it looks like the pretty printer is still not registered.
>> Have you set up your gdbinit to register the printer?
>
> To me it sounds like gdb.lookup_type not finding the struct types
> representing the attributes. I'm not sure what could be causing that;
> I've tested it with gdb 7.7 and 7.11 in x86_64, and 7.7 in ARM and it
> always worked fine. Could you at least test it in x86?
>
I've tested it on a fedora 23 i686 vm with the following packages:
-python2-pexpect-4.0.1-4.fc23.noarch
-gdb-7.10-23.fc23.i686
As mentioned by Siddhesh the ~/.gdbinit contains:
python
import sys
sys.path.insert(0, '/home/stli/glibcDir/glibc-20160712_pp-build/nptl/')
end
source /home/stli/glibcDir/glibc/nptl/nptl-printers.py
add-auto-load-safe-path /home/stli/glibcDir/glibc-20160712_pp-build/nptl_db
Here is the output of the pp-tests:
FAIL: pretty-printers/test-condvar-attributes-pp
FAIL: pretty-printers/test-mutex-attributes-pp
FAIL: pretty-printers/test-rwlock-attributes-pp
env python test-mutex-attributes.py test-mutex-attributes.c
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-mutex-attributes;
\
../scripts/evaluate-test.sh pretty-printers/test-mutex-attributes-pp $?
false false >
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-mutex-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_mutexattr_t
Response: Python Exception <class 'gdb.error'> No struct type named
pthread_mutexattr.:
Python Exception <class 'gdb.error'> No struct type named
pthread_mutexattr.:
$1 = {__size = "\002\000\000", __align = 2}
gdb-test%
env python test-condvar-attributes.py test-condvar-attributes.c
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-condvar-attributes;
\
../scripts/evaluate-test.sh pretty-printers/test-condvar-attributes-pp
$? false false >
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-condvar-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_condattr_t
Response: Python Exception <class 'gdb.error'> No struct type named
pthread_condattr.:
Python Exception <class 'gdb.error'> No struct type named
pthread_condattr.:
$3 = {__size = "\000\000\000", __align = 0}
gdb-test%
env python test-rwlock-attributes.py test-rwlock-attributes.c
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-rwlock-attributes;
\
../scripts/evaluate-test.sh pretty-printers/test-rwlock-attributes-pp $?
false false >
/home/stli/glibcDir/glibc-20160712_pp-build/pretty-printers/test-rwlock-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_rwlockattr_t
Response: Python Exception <class 'gdb.error'> No struct type named
pthread_rwlockattr.:
Python Exception <class 'gdb.error'> No struct type named
pthread_rwlockattr.:
$3 = {__size = "\000\000\000\000\000\000\000", __align = 0}
gdb-test%
>>> Nevertheless is it possible to check the correct versions and warn
>>> at configuring or mark the tests as unsupported if pexpect is not installed
>>> or you have the false version?
>
> I wasn't aware of versioning issues on PExpect. FWIW I saw that the
> module has a __version__ attribute, so we could set a minimum version
> (4.0.1 maybe?) and mark the tests as UNSUPPORTED if our version is
> lower. It would require a bit of string parsing but it should be
> relatively easy to do.
>
I just see that the python-pexpect.noarch package in fc23 is version
3.1. You could install it instead of python2-pexpect.noarch (version
4.0.1) in order to test your version checking?
More information about the Libc-alpha
mailing list