[PATCH v5 3/5] objdump: Add variable types and structure for DWARF info parsing

Nick Clifton nickc@redhat.com
Fri Oct 31 14:04:33 GMT 2025


Hi Jan, Hi Guillaume,

>>> I remain hesitant. Nick - any opinion?
>>
>> Err, OK, I admit that I am out of the loop on this one.  What exactly is
>> the issue ?
>>
>> Obviously both objdump and readelf can display DWARF debug information.
>> And since they use the same source file to do this, their functionality
>> ought to be basically equivalent.  What am I missing ?
> 
> Guillaume wants to add functionality which doesn't really fit either tool,
> for going quite a bit beyond "dumping" or "reading".

So Guillaume is proposing an addition which would display information on the
location and types of all global variables in a binary, based upon its DWARF
information.  Is this correct ?

The issues are:
   a) is this functionality appropriate for the one or more of the binutils tools ?

   b) is the functionality safe to add since it is quite large and hence likely to
      the subject of future issues ?

   c) where is the best place to add the functionality ?

Have I got this right so far ?

If so then in my opinion:
   a) Yes.  One of the main purposes of the binutils tools is to aid programmers
      by allowing inspection of their binary files.  Adding functionality that
      does this is therefore a good thing.

   b) Given that there will always be bugs, we should not be afraid of adding new
      code.  That said there is no reason to be cavalier about it.  Paranoid
      programming, extensive tests and lots of documentation should always be
      considered, especially for new features.

   c) Both objdump and readelf seem like suitable tools.  So adding the bulk of
      the binutils/dwarf.c file would seem to be the best location.

I hope that this helps.

Cheers
   Nick




More information about the Binutils mailing list