This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] tui: don't overwrite a subprompt line that was given no input
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Fri, 21 Aug 2015 19:04:27 +0100
- Subject: Re: [PATCH] tui: don't overwrite a subprompt line that was given no input
- Authentication-results: sourceware.org; auth=none
- References: <1440175538-8021-1-git-send-email-patrick at parcs dot ath dot cx>
On 08/21/2015 05:45 PM, Patrick Palka wrote:
> This patch fixes the following bug in TUI:
>
> (gdb) break foo
> No symbol table is loaded. Use the "file" command.
> Make breakpoint pending on future shared library load? (y or [n]) <ENTER>
>
> By submitting an empty command line to a subprompt, the subprompt line
> is undesirably cleared and overwritten. Outside of a subprompt,
> clearing the prompt line after submitting an empty command line is
> intended behavior which complements GDB's repeat-command shorthand. But
> inside a subprompt, this behavior is undesired since the shorthand is
> not applicable in that case. We should retain the subprompt line even
> when it's given to input.
>
> This patch makes sure that a prompt given an empty command line is
> cleared and overwritten only if it's not a subprompt. To acheive this,
> a new predicate is defined which informs us whether the current input
> handler is a subprompt.
>
> gdb/ChangeLog:
>
> * top.h (gdb_in_subprompt_p): Declare.
> * top.c (gdb_subprompt_depth): Define.
> (gdb_in_subprompt_p): Define.
> (gdb_readline_wrapper_cleanup): Decrement gdb_subprompt_depth.
> (gdb_readline_wrapper): Increment gdb_subprompt_depth.
> * tui/tui-io.c (tui_getc): Don't clear the prompt line if we
> are in a subprompt.
OK, but should really be s/subprompt/secondary prompt/ everywhere.
Thanks,
Pedro Alves