Fix help formatting for string and filename options
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
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.
---
gdb/cli/cli-option.c | 4 ++--
gdb/testsuite/gdb.base/options.exp | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
Comments
On Mon, 13 Jan 2025 07:33:49 -0700
Tom Tromey <tromey@adacore.com> wrote:
> 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.
LGTM.
Approved-by: Kevin Buettner <kevinb@redhat.com>
@@ -832,10 +832,10 @@ append_val_type_str (std::string &help, const option_def &opt,
help += "NUMBER|#RRGGBB";
break;
case var_string:
- help += "STRING";
+ help += " STRING";
break;
case var_filename:
- help += "FILENAME";
+ help += " FILENAME";
break;
default:
break;
@@ -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"