From: Tom Tromey Date: Mon, 13 Jan 2025 14:26:10 +0000 (-0700) Subject: Fix help formatting for string and filename options X-Git-Tag: gdb-16.1-release~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52b81397b157ac237f7fd6b249e9540e8563bf7f;p=thirdparty%2Fbinutils-gdb.git Fix help formatting for string and filename options I happened to notice that "help add-inferior" said: -execFILENAME FILENAME is the file name of the executable to use as the main program. This is missing a space after "-exec". This patch fixes the bug. If ok'd on time I plan to check this in to the gdb-16 branch as well. Approved-by: Kevin Buettner (cherry picked from commit 6511d20c9d47093acb3b099ff19854e01bbe9af4) --- diff --git a/gdb/cli/cli-option.c b/gdb/cli/cli-option.c index fa00b913c99..712bcd74cb9 100644 --- a/gdb/cli/cli-option.c +++ b/gdb/cli/cli-option.c @@ -790,10 +790,10 @@ append_val_type_str (std::string &help, const option_def &opt, } break; case var_string: - help += "STRING"; + help += " STRING"; break; case var_filename: - help += "FILENAME"; + help += " FILENAME"; break; default: break; diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index e1ad61e6470..a1ca39eab11 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -1162,3 +1162,9 @@ test-thread-apply # Basic "info threads" integration tests. test-info-threads + +# There was a bug where the "metasyntactic variable" was glued to the +# option. +gdb_test "help maintenance test-options unknown-is-operand" \ + "-string STRING.*-filename FILENAME.*" \ + "option help has spaces"