From: Andrew Burgess <aburgess@redhat.com>
To: "Kartik K. Agaram" <ak@akkartik.com>, gdb-patches@sourceware.org
Cc: guinevere@redhat.com, "Kartik K. Agaram" <ak@akkartik.com>
Subject: Re: [PATCH v4] gdb: redo whitespace-stripping from commands
Date: Tue, 08 Jul 2025 10:27:55 +0100 [thread overview]
Message-ID: <87plebm3qc.fsf@redhat.com> (raw)
In-Reply-To: <20250606161014.1367913-2-ak@akkartik.com>
"Kartik K. Agaram" <ak@akkartik.com> writes:
> Before this patch, trailing whitespace was not stripped from 'set' and
> 'complete' commands. Now I've added 'with' to that list of commands
> because it may contain one of those commands. To accomplish this, I'm
> fixing an ancient TODO to provide a per-command flag controlling
> whitespace-stripping.
>
> Any subcommands of 'with' besides 'complete' or 'set' will continue to
> strip whitespace as before, because they go through a recursive call to
> execute_command. The outer call for 'with' won't strip whitespace, then
> the recursive call will.
>
> I've also cleaned up 2 obsolete TODOs and NOTEs in related code.
>
> Tested on x86_64-linux.
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29784
> Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
> ---
> Changes for v4:
> * Ugh, removed a stray quote character from the commit description.
>
> gdb/cli/cli-cmds.c | 11 ++++-------
> gdb/cli/cli-cmds.h | 4 ----
> gdb/cli/cli-decode.c | 1 +
> gdb/cli/cli-decode.h | 8 ++++----
> gdb/top.c | 12 +-----------
> 5 files changed, 10 insertions(+), 26 deletions(-)
It feels like this commit could have some tests added. There is a
support library 'completion-support.exp', if you look for the pattern
'load_lib completion-support.exp' in the testsuite then you'll find
plenty of examples of its use.
Do take care though, there are some completion tests that pre-date the
completion-support.exp library -- if you find a test that is manually
sending tabs to GDB without using the support library, then it's
probably an older test, and not a good example to learn from.
Unfortunately, completion tests are towards the harder end of tests to
write (I find anyway), but I think it is worth doing. Do feel free to
ask if you get stuck.
Thanks,
Andrew
prev parent reply other threads:[~2025-07-08 9:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 12:51 [PATCH] RFC: " Kartik K. Agaram
2025-05-29 13:36 ` Tom Tromey
2025-05-29 13:53 ` Kartik Agaram
2025-05-29 13:53 ` Guinevere Larsen
2025-05-29 13:59 ` Kartik Agaram
2025-05-29 15:35 ` Tom Tromey
2025-06-01 1:17 ` Kartik K. Agaram
2025-06-01 1:17 ` [PATCH] " Kartik K. Agaram
2025-06-02 16:30 ` Guinevere Larsen
2025-06-02 16:42 ` Kartik Agaram
2025-06-02 23:39 ` [PATCH v3] " Kartik K. Agaram
2025-06-06 16:10 ` [PATCH v4] " Kartik K. Agaram
2025-07-07 17:59 ` Kartik Agaram
2025-07-08 9:27 ` Andrew Burgess [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87plebm3qc.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=ak@akkartik.com \
--cc=gdb-patches@sourceware.org \
--cc=guinevere@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox