diff options
author | Andrew Burgess <aburgess@redhat.com> | 2025-03-13 16:29:07 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2025-03-17 17:32:36 +0000 |
commit | 71f193a5c1cb02dcde6ac160cdab88e9725862bb (patch) | |
tree | c96408fc4d27c8759e6897e701872b5aeb084aae /gdb/doc | |
parent | a6924ac89d75188cd9ad3b740226db11798520dd (diff) | |
download | binutils-71f193a5c1cb02dcde6ac160cdab88e9725862bb.zip binutils-71f193a5c1cb02dcde6ac160cdab88e9725862bb.tar.gz binutils-71f193a5c1cb02dcde6ac160cdab88e9725862bb.tar.bz2 |
gdb-add-index: add --help and --version options
Update the gdb-add-index script to offer --help and --version options.
The script currently accepts the argument '-dwarf-5' with a single
leading '-'. As two '--' is more common for long options, the
preferred argument form is now '--dwarf-5', the docs have been
updated, and the new help text uses this form.
For backward compatibility, the old '-dwarf-5' form is still
accepted.
The new arguments are '--help' or '-h', but I also accept '-help' for
consistency with '-dwarf-5'. And likewise for the version argument.
Handling of the gdb-add-index script is done basically the same as for
gcore and gstack; we use config.status to create a .in file within the
build directory, which is then processed by the Makefile to create the
final script.
The difference with gdb-add-index is that I left the original script
as gdb/contrib/gdb-add-index.sh rather than renaming it to something
like gdb/contrib/gdb-add-index-1.in, which is how gcore and gstack are
handled (though they are not in the contrib directory).
The reason for this is that the contrib/cc-with-tweaks.sh script looks
for gdb-add-index.sh within the gdb/contrib/ source directory.
As the only reason we process gdb-add-index.sh into the build
directory is to support the PKGVERSION and VERSION variables, allowing
cc-with-tweaks to continue using the unprocessed version seems
harmless, and avoids having to change cc-with-tweaks.sh at all.
I tested that I can still run tests using the cc-with-gdb-index target
board, and that the installed gdb-add-index script correctly shows a
version number when asked.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32325
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 96d624e..4734310 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -51643,7 +51643,7 @@ Richard M. Stallman and Roland H. Pesch, July 1991. @c man title gdb-add-index Add index files to speed up GDB @c man begin SYNOPSIS gdb-add-index -gdb-add-index [-dwarf-5] @var{filename} +gdb-add-index [-h | --help] [-v | --version] [--dwarf-5] @var{filename} @c man end @c man begin DESCRIPTION gdb-add-index @@ -51661,8 +51661,8 @@ which use ELF binaries and DWARF debug information (i.e., sections named @code{.debug_*}). By default @command{gdb-add-index} will add a pre-DWARF 5 -@code{.gdb_index} section to @var{filename}. With @option{-dwarf-5} -DWARF 5 sections are added instead. +@code{.gdb_index} section to @var{filename}. With @option{--dwarf-5} +the DWARF 5 section @code{.debug_names} is added instead. @var{filename} must be writable. @@ -51686,9 +51686,16 @@ the @value{GDBN} manual in node @code{Index Files} @c man begin OPTIONS gdb-add-index @table @env -@item -dwarf-5 +@item --dwarf-5 Add DWARF 5 sections instead of previous @code{.gdb_index} section. +@item --help +@itemx -h +List all options, with brief explanations. + +@item --version +@itemx -v +Print version information and then exit. @end table @c man end |