This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] TUI: rewrite tui_query_hook()


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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]