This is the mail archive of the
mailing list for the glibc project.
Re: [RFC] Pretty printers for NPTL lock types
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Martin Galvan <martin dot galvan at tallertechnologies dot com>, libc-alpha at sourceware dot org, Daniel Gutson <daniel dot gutson at tallertechnologies dot com>, Torvald Riegel <triegel at redhat dot com>, Pedro Alves <palves at redhat dot com>
- Date: Wed, 11 Mar 2015 15:37:08 -0400
- Subject: Re: [RFC] Pretty printers for NPTL lock types
- Authentication-results: sourceware.org; auth=none
- References: <CAOKbPbbVud=gru917mXYfnOnQ9nCCY1vR4fvyU8JpRVzaGe5bw at mail dot gmail dot com>
On 03/11/2015 11:21 AM, Martin Galvan wrote:
> As you can see, I used several global variables to represent the
> macros used in the NPTL code (e.g. those defined in pthreadP.h). I'm
> aware of how ugly this is, as they'll have to be maintained together
> with the NPTL values, but the alternative would be having users
> re-compile their glibc with debugging symbols (even then I'm not sure
> if it would work). Any suggestions on how to improve this will be
At a high level this is looking good and making progress, I like that
you print the type of mutex, the status, the robust info, etc, it's
all very good information.
I would like to hear more about your testing.
I would suggest two ways to test this:
(a) Using gdb on the command line.
(b) Using Eclipse + CDT to debug native applications with a gdb that
sources this information. Then in the debug view look at what happens
when you inspect a mutex object.
As Tom noted the pretty-printers don't print things, they return strings
that the higher level gdb then presents to the user.
The last time I did this there were two easy ways to do this:
(1) Return some kind of long string with data the user can read.
(2) Return a tabular structure supported by gdb which results in
a tabular view for higher level IDEs using gdb's machine interface
e.g. gdb/MI, and I think the table view was `[var="val", ...]`,
but I can't remember.
Please post a v2 for review and detail your testing please.