[PATCH][PR <gdb/29784>] Fix: Trailing whitespace omitted when using "with" command

Tom Tromey tom@tromey.com
Thu Sep 21 19:41:24 GMT 2023


>>>>> "Sahil" == Sahil Siddiq via Gdb-patches <gdb-patches@sourceware.org> writes:

Sahil> Consider the following usage of the "complete" command (<SP>
Sahil> represents a whitespace):
[...]

Thank you for the patch.

Sahil> Given that the "with" command is used to temporarily change the value of
Sahil> a setting before running a specific command, execute_command() should
Sahil> not clear trailing spaces until it evaluates the COMMAND to be run
Sahil> following the "--" delimiter.

I agree there's a bug here.

I am not completely sure about the fix.  It seems like it could do the
wrong thing when completing "with" where the "sub-command" is not
"complete".

I think a test case is required as well.  It can probably be added to
some existing test.

Sahil> +	  && strcmp(c->name, "with")

gdb style is a space before the paren and an explicit "!= 0".
Or you can use "!streq".

thanks,
Tom


More information about the Gdb-patches mailing list