binutils-gdb/gdb/tui
Patrick Palka 948578a989 tui: don't overwrite a secondary prompt that was given no input
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 secondary prompt, the line
corresponding to the secondary prompt is undesirably cleared and
overwritten.  Outside of a secondary prompt, clearing the prompt line
after submitting an empty command line is intended behavior which
complements GDB's repeat-command shorthand.  But inside a secondary
prompt, this behavior is undesired since the shorthand is not applicable
in that case.  We should retain the secondary-prompt line even when it's
given no input.

This patch makes sure that a prompt that was given an empty command line
is cleared and overwritten only if it's not a secondary prompt.  To
acheive this, a new predicate is defined which informs us whether the
current input handler is a secondary prompt.

gdb/ChangeLog:

	* top.h (gdb_in_secondary_prompt_p): Declare.
	* top.c (gdb_secondary_prompt_depth): Define.
	(gdb_in_secondary_prompt_p): Define.
	(gdb_readline_wrapper_cleanup): Decrement
	gdb_secondary_prompt_depth.
	(gdb_readline_wrapper): Increment gdb_secondary_prompt_depth.
	* tui/tui-io.c (tui_getc): Don't clear the prompt line if we
	are in a secondary prompt.
2015-08-21 16:18:39 -04:00
..
ChangeLog-1998-2003
tui-command.c
tui-command.h
tui-data.c Remove fields curch and cur_line from TUI_CMD_WIN 2015-08-20 23:06:47 -04:00
tui-data.h Remove fields curch and cur_line from TUI_CMD_WIN 2015-08-20 23:06:47 -04:00
tui-disasm.c
tui-disasm.h
tui-file.c
tui-file.h
tui-hooks.c
tui-hooks.h
tui-interp.c
tui-io.c tui: don't overwrite a secondary prompt that was given no input 2015-08-21 16:18:39 -04:00
tui-io.h
tui-layout.c
tui-layout.h
tui-out.c
tui-regs.c
tui-regs.h
tui-source.c
tui-source.h
tui-stack.c
tui-stack.h
tui-win.c Remove fields curch and cur_line from TUI_CMD_WIN 2015-08-20 23:06:47 -04:00
tui-win.h
tui-windata.c
tui-windata.h
tui-wingeneral.c
tui-wingeneral.h
tui-winsource.c
tui-winsource.h
tui.c
tui.h