[RFC] Pretty printers for NPTL lock types
Martin Galvan
martin.galvan@tallertechnologies.com
Wed Mar 11 17:28:00 GMT 2015
On Wed, Mar 11, 2015 at 1:31 PM, Tom Tromey <tom@tromey.com> wrote:
>>>>>> "Martin" == Martin Galvan <martin.galvan@tallertechnologies.com> writes:
>
> Martin> if self.lock == PTHREAD_MUTEX_UNLOCKED:
> Martin> print("* Status: Unlocked")
> Martin> else: # Mutex is locked
> Martin> if self.lock & FUTEX_WAITERS:
> Martin> print("* Status: Locked, possibly with waiters")
> Martin> else:
> Martin> print("* Status: Locked, no waiters")
>
> Despite their name, gdb pretty-printers shouldn't actually print
> anything. Really they are value-transformers and should either return a
> string value (for scalar-like objects) or an iterable of some kind (for
> aggregate objects).
My mistake, I thought the printers themselves were supposed to do the
actual printing. I'll refactor them accordingly. Thanks for the
feedback!
More information about the Libc-alpha
mailing list