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, 15 May 2015, Martin Galvan wrote:

> On Fri, May 15, 2015 at 8:02 PM, Martin Galvan
> <martin.galvan@tallertechnologies.com> wrote:
> > 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.
> 
> Come to think about it, though, I don't see what would be the real
> advantage of doing this over simply updating printers.py. In both

It avoids having two copies of the values you need to make sure stay in 
sync.

> cases the maintainer would have to update both the header and a
> separate file that'll be used by the printers. How exactly does
> gen-as-const work?

It generates a C source file that uses the C constant as an asm operand, 
in an asm containing special text that can then be matched in the compiler 
output to extract the value of a constant.

-- 
Joseph S. Myers
joseph@codesourcery.com


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