This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add pretty printers for the NPTL lock types


On Fri, May 15, 2015 at 7:46 PM, Martin Galvan
<martin.galvan@tallertechnologies.com> wrote:
> Hi Joseph! Thanks a lot for the feedback.
> On Fri, May 15, 2015 at 5:42 PM, Joseph Myers <joseph@codesourcery.com> wrote:
>> I think we must eliminate this duplication before this patch can go in.
>> That is, set up some mechanism for the values to be extracted at build /
>> install time.  In addition, whenever this depends on some aspect of NPTL
>> internals, there need to be comments on the relevant internals (e.g.
>> structure field definitions) explaining how this code depends on them and
>> so needs updating for any change.  Similarly, if this code is meant to
>> handle all values in an enumeration / all flags from some set of flags,
>> there needs to be a comment on that enumeration / set of flags drawing
>> attention to the need to update this code when new values are added.
>
> Wouldn't commenting on the headers suffice? Those values are scattered
> all over the place. I *could* try to build an additional Python script
> to extract them from the headers somehow, but it's probably gonna take
> a lot of time.

Actually, disregard that. I took a look at how gen-as-const seems to
work, and noticed each directory is used on has a .sym file with all
the macros and such neatly set for awk to do its thing. Silly me, I
thought you were asking me to extract them from the .h files
themselves.

What I'm gonna do is, import a macros.py file in printers.py.
macros.py will in turn be generated from a .sym file where I'll place
all the macros/enums I need. Then I'll add some comments pointing out
that any updates to the headers should be reflected on the .sym file.

The only hassle here will be integrating this to the NPTL Makefile,
though, but I'll see what I can do.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]