[PATCH] decoded output of .debug_line from readelf -wL

Nick Clifton nickc@redhat.com
Tue Feb 27 15:09:00 GMT 2007


Hi Tor,

> I added the option -WL to readelf for outputting decoded address/line
> information from the .debug_line section.
> 
> Let me know if you have any suggestions for improving the output or the 
> source.

Certainly:

   *) Please use xmalloc() rather than malloc().  That way you also do
      not need to check for a NULL return pointer.

   *) Please read the GNU Coding Standard:

         http://www.gnu.org/prep/standards/

      Especially with reference to the formatting of comments and
      function calls.

   *) The -wL and -wl command line options ought to display different
      comments at the start of their output, and if both switches are
      used then both comments should be displayed.  eg:

        % readelf -wlL foo.o
        Raw dump of debug contents of section .debug_line:
          ...
        Decoded dump of debug contents of section .debug_line:
          ...

    *) The new command line option needs to be documented in
       binutils/binutils.texi and mentioned in binutils/NEWS.

    *) It would be nice to have an option to suppress the output of the
       column number, as this can be rather confusing.  It would be
       especially nice if this was done automatically if the column is
       always zero, unless the user has used a command line option to
       specifically request column numbers.

    *) It would be nice if there were headings at the start of the
       decoded information for each compilation unit, and if you used a
       little more white space.  eg:

       CU: /work/sources/gcc/current/libgcc/gcc/config/arm/ieee754-df.S:
       FILE NAME      LINE NUMBER   STARTING ADDRESS
        ieee754-df.S    1304          0x00010dd8
        ieee754-df.S    1305          0x00010ddc

       You might also want to restrict the number of characters printed
       for the file name unless the --wide command line option has been
       enabled.

Other than that the patch looks very nice indeed.

Cheers
   Nick



More information about the Binutils mailing list