[RFC v2] Pretty printers for NPTL lock types

Martin Galvan martin.galvan@tallertechnologies.com
Thu Mar 12 17:34:00 GMT 2015


Changes from v1:
  * Rewrote the printers so that to_string returns a string instead of
doing the actual printing.

Follow-up from https://sourceware.org/ml/libc-alpha/2015-03/msg00472.html .

This patch adds the pretty-printers for the following NPTL types:

- pthread_mutex_t
- pthread_mutexattr_t
- pthread_cond_t
- pthread_condattr_t
- pthread_rwlock_t
- pthread_rwlockattr_t

I've tested the printers on both the gdb CLI and Eclipse CDT. The
Eclipse version works fine when using the gdb console, but hovering
over the variables' names won't show the pretty printers' output as it
should (perhaps this is an Eclipse problem?).

The testing was made on a few simple examples, some of which deadlock
on purpose. I'm not sure of how could I offer more detail on my
testing; do I have to provide unit tests at this stage? If that's the
case I could write a few Python scripts which could drive gdb over the
examples and try using something like PExpect to check the output of
the pretty printers.

-- 

Martín Galván

Software Engineer

Taller Technologies Argentina

San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina

Phone: 54 351 4217888 / +54 351 4218211
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printers.py
Type: text/x-python
Size: 17823 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150312/4bf7a6d8/attachment.py>


More information about the Libc-alpha mailing list