[RFC] extending bfd_print_private_bfd_data
Dave Korn
dave.korn.cygwin@googlemail.com
Wed Nov 4 14:50:00 GMT 2009
Tristan Gingold wrote:
> some formats (pe, coff, mach-o) may dump a lot of information with
> 'objdump -p'. This is somewhat boring
> if you need only to dump a specific part of that (for example only the
> characteristics of a PE file).
I do find myself using "objdump -p | grep" quite a lot to extract a single
field.
> From a user point of view:
> Add a new switch to objdump: -P xx, where xx is a word or a list of
> words separated by a comma.
> The definition of the words are back-end specific.
> Add new parameter 'const char *what' to bfd_print_private_bfd_data, to
> describe what has to be displayed.
> WHAT should only be a word (ie the handling of a list of words is done
> by objdump).
> If the word is not recognized by print_private_bfd_data, then FALSE must
> be returned.
> Comments are welcome,
As long as you're going to the lengths of accepting a list of names from the
backend and parsing them all and passing them back one at a time to the
backend, why not go that little way further and build a word full of flag bits
instead? It would save all the bfd_print_private_bfd_data routines from
filling up with lots of ugly strcmps if they could just check a bitmask.
cheers,
DaveK
More information about the Binutils
mailing list