]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb-add-index: add --help and --version options
authorAndrew Burgess <aburgess@redhat.com>
Thu, 13 Mar 2025 16:29:07 +0000 (16:29 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 17 Mar 2025 17:32:36 +0000 (17:32 +0000)
commit71f193a5c1cb02dcde6ac160cdab88e9725862bb
treec96408fc4d27c8759e6897e701872b5aeb084aae
parenta6924ac89d75188cd9ad3b740226db11798520dd
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>
gdb/Makefile.in
gdb/NEWS
gdb/configure
gdb/configure.ac
gdb/contrib/gdb-add-index.sh
gdb/doc/gdb.texinfo