This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] TUI: rewrite tui_query_hook()
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 8 Jan 2015 09:25:28 -0500
- Subject: Re: [PATCH] TUI: rewrite tui_query_hook()
- Authentication-results: sourceware.org; auth=none
- References: <1420689048-23538-1-git-send-email-patrick at parcs dot ath dot cx> <54AE640B dot 3000701 at redhat dot com> <CA+C-WL9Rjo3sHC1P4wHWB37uuvxUoPVPaypr3dQ9yvJU0D_-ZA at mail dot gmail dot com> <54AE8BDB dot 3050100 at redhat dot com> <CA+C-WL8w=04SMCy4QfFaTBbuJvty6CZWHLiAE7iGKJNwo0n5ng at mail dot gmail dot com>
On Thu, Jan 8, 2015 at 9:10 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Thu, Jan 8, 2015 at 8:53 AM, Pedro Alves <palves@redhat.com> wrote:
>> On 01/08/2015 12:40 PM, Patrick Palka wrote:
>>
>>> If we use
>>> gdb_readline_wrapper to print the query and wait for input then the
>>> 2nd annotation will not be printed in a timely manner because
>>> gdb_readline_wrapper blocks until a response is given by the user.
>>
>> Can't we just cat the annotations bits into the query string
>> itself? IOW, make them part of the secondary prompt.
>
> I'm not sure because the annotations contain newlines, so (with
> annotations enabled) the prompt passed to readline would have
> newlines. I do not know if readline supports multi-line prompts.
Actually readline does support multi-line prompts because what you
mentioned is exactly what prompt_for_continue() does. It concatenates
the annotations to the prompt string and passes the multi-line prompt
to gdb_readline_wrapper(). So it will be easy to consolidate these
two query hooks. I will try to do so.
>
> But IMO a consolidation of the custom TUI query hook and the default
> query hook is a quite separate endeavor. I think it should be left as
> future work.
>
>>
>> Thanks,
>> Pedro Alves
>>