[RFC] readelf -w/-debug-dump= association

Fangrui Song i@maskray.me
Thu May 27 06:02:57 GMT 2021

On 2021-05-27, Alan Modra via Binutils wrote:
>I'm soliciting opinions on this change to readelf --help, which I
>think is good but I might be a little too familiar with readelf to
>judge well.
>The idea is to make it a little easier to learn, for example, that -wo
>is shorthand for --debug-dump=loc.  Also to ensure that people adding
>new --debug-dump= options put the associated -w option in the correct
>	* readelf.c (usage): Associate -w and --debug-dump options closely.
>diff --git a/binutils/readelf.c b/binutils/readelf.c
>index a6ed24c03bd..9844a9229c3 100644
>--- a/binutils/readelf.c
>+++ b/binutils/readelf.c
>@@ -4653,10 +4653,10 @@ usage (FILE * stream)
>   -R --relocated-dump=<number|name>\n\
>                          Dump the contents of section <number|name> as relocated bytes\n\
>   -z --decompress        Decompress section before dumping it\n\
>-  -w[lLiaprmfFsOoRtgUuTAc] or\n\
>-  --debug-dump=[rawline,decodedline,info,abbrev,pubnames,aranges,macro,frames,\n\
>-                frames-interp,str,str-offsets,loc,Ranges,pubtypes,gdb_index,\n\
>-                trace_info,trace_abbrev,trace_aranges,addr,cu_index]\n\
>+  -w/--debug-dump=[a/abbrev, A/addr, r/aranges, c/cu_index, L/decodedline,\n\
>+                   f/frames, F/frames-interp, g/gdb_index, i/info, o/loc,\n\
>+                   m/macro, p/pubnames, t/pubtypes, R/Ranges, l/rawline, s/str\n\
>+                   O/str-offsets, u/trace_abbrev, T/trace_aranges, U/trace_info]\n\
>                          Display the contents of DWARF debug sections\n\
>   -wk,--debug-dump=links Display the contents of sections that link to separate debuginfo files\n\
>   -P,--process-links     Display the contents of non-debug sections in separate debuginfo files.  (Implies -wK)\n"));

This is a great idea.

Previously it was difficult to associate the shortcuts to the long

More information about the Binutils mailing list