From: Tom Tromey <tromey@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>,
Phil Muldoon <pmuldoon@redhat.com>
Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class
Date: Thu, 10 Apr 2014 16:27:00 -0000 [thread overview]
Message-ID: <87a9btqhe3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3iorj3ud8.fsf@redhat.com> (Sergio Durigan Junior's message of "Wed, 12 Mar 2014 19:49:39 -0300")
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> This PR came from a Red Hat bug that was filed recently. I checked and
Sergio> it still exists on HEAD, so here's a proposed fix. Although this is
Sergio> marked as a Python backend bug, this is really about the completion
Sergio> mechanism used by GDB. Since this code reminds me of my first attempt
Sergio> to make a good noodle, it took me quite some time to fix it in a
Sergio> non-intrusive way.
Thanks, Sergio.
Sergio> +/* Python function called to determine the break characters of a
Sergio> + certain completer. We use dummy variables for the "text" and
Sergio> + "word" arguments for the completer, and call it. We're actually
Sergio> + only interested in knowing if the completer registered by the user
Sergio> + will return one of the integer codes (see COMPLETER_* symbols). */
Sergio> +
Sergio> +static void
Sergio> +cmdpy_completer_handle_brkchars (struct cmd_list_element *command)
Sergio> +{
IIUC this is calling the command's complete method with some dummy strings
to see what it will do.
I don't think this approach will work since in general the reason to
write a complete method is to be able to adapt to different arguments.
That is, there's no reason to expect that passing dummy arguments will
yield the same result.
I didn't look deeply into the problem but is there a way to "reparse"
the text when the complete method returns one of the enum values?
Tom
next prev parent reply other threads:[~2014-04-10 16:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 22:49 Sergio Durigan Junior
2014-03-22 2:54 ` Sergio Durigan Junior
2014-04-04 20:41 ` Sergio Durigan Junior
2014-04-10 16:27 ` Tom Tromey [this message]
2014-05-03 0:04 ` Sergio Durigan Junior
2014-05-20 19:12 ` Tom Tromey
2014-05-21 2:09 ` Sergio Durigan Junior
2014-05-21 7:48 ` Doug Evans
2014-07-01 0:59 ` Sergio Durigan Junior
2014-07-08 15:32 ` Jan Kratochvil
2014-07-08 18:17 ` Jan Kratochvil
2014-07-08 20:30 ` Sergio Durigan Junior
2014-08-19 23:02 ` Sergio Durigan Junior
2014-09-02 16:31 ` Sergio Durigan Junior
2014-09-03 4:03 ` Doug Evans
2014-09-03 20:36 ` Sergio Durigan Junior
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=87a9btqhe3.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=sergiodj@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