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 07:40:21 -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>
On Thu, Jan 8, 2015 at 6:03 AM, Pedro Alves <palves@redhat.com> wrote:
> On 01/08/2015 03:50 AM, Patrick Palka wrote:
>> This patch rewrites tui_query_hook() to print things via tui_puts() and
>> to read in a line of input via wgetnstr(). The main motivation for this
>> rewrite is to get the backspace key to work correctly during a quit
>> prompt so that the user can revise their answer before pressing enter.
>> The backspace key now works correctly because we now use getstr()
>> instead of successive calls to getch().
>
> Pagination, done in prompt_for_continue, gets away without this hook, as
> it's written in terms of readline. If we did the same to defaulted_query,
> I think the default code would just work for the TUI too. Did you
> consider that?
This is complicated by the fact that the default query code inserts
annotations before and after the query. 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.
>
> Thanks,
> Pedro Alves
>