This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] extending bfd_print_private_bfd_data
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 04 Nov 2009 15:05:32 +0000
- Subject: Re: [RFC] extending bfd_print_private_bfd_data
- References: <7B70E8E3-6EC5-48AF-8564-E2C92184FB31@adacore.com>
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