From: nt8r@protonmail.com
To: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: Tab complete internalvars in expressions
Date: Thu, 22 Aug 2024 19:41:01 +0000 [thread overview]
Message-ID: <HyPJwVQbdCLo33x_-05gx1LWSHB68L3MSuMrhIPz_O8Ljt_qKneJACuclrKcoH8B7Hhv0JEix2h-XWPgU8w5OEFFKI7RppLmZUU_dlQR86Y=@protonmail.com> (raw)
In-Reply-To: <20240822154730.1595141-3-nt8r@protonmail.com>
It seems I misunderstood the semantics of the 'word' and 'text' parameters here. I'll correct in v2; as written this doesn't work for completions not at the start of the text to complete (e.g. 'print 4+$fo<tab>' or 'print $fo<tab>+4').
On Thursday, August 22nd, 2024 at 3:47 PM, Antonio Rische <nt8r@protonmail.com> wrote:
> For example, 'print $f<tab>' after running 'set $foo=0' now tab
>
> completes.
>
> 'print $_siginf<tab>' also now tab completes.
>
> ---
> gdb/completer.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/gdb/completer.c b/gdb/completer.c
> index 1008ec23b..6476ddf79 100644
> --- a/gdb/completer.c
> +++ b/gdb/completer.c
> @@ -1099,6 +1099,16 @@ complete_expression (completion_tracker &tracker,
> && expr_completer->complete (exp.get (), tracker))
>
> return;
>
> + if (text[0] == '$')
> + {
> + tracker.advance_custom_word_point_by (1);
> + /* We don't support completion of history indices. */
> + if (!isdigit (text[1]))
> + complete_internalvar (tracker, &text[1]);
> + tracker.advance_custom_word_point_by (-1);
> + return;
> + }
> +
> complete_files_symbols (tracker, text, word);
> }
>
> --
> 2.46.0
next prev parent reply other threads:[~2024-08-22 19:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 15:47 [PATCH 0/2] Tab complete convenience variables Antonio Rische
2024-08-22 15:47 ` [PATCH 1/2] gdb: Do not create variables when parsing expressions Antonio Rische
2024-08-22 15:47 ` [PATCH 2/2] gdb: Tab complete internalvars in expressions Antonio Rische
2024-08-22 19:41 ` nt8r [this message]
2024-08-26 16:54 ` Keith Seitz
2024-08-28 1:36 ` nt8r
2024-08-28 2:30 ` Eli Zaretskii
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='HyPJwVQbdCLo33x_-05gx1LWSHB68L3MSuMrhIPz_O8Ljt_qKneJACuclrKcoH8B7Hhv0JEix2h-XWPgU8w5OEFFKI7RppLmZUU_dlQR86Y=@protonmail.com' \
--to=nt8r@protonmail.com \
--cc=gdb-patches@sourceware.org \
/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