old-cross-binutils/gdb/tui
Andrew Burgess 51f0e40d65 gdb: Rework command completion on 'tui reg'.
We previously specified a few known register groups for the 'tui reg'
command.  Other register groups could be accessed, but only by using the
'tui reg next' command and cycling through all the groups.

This commit removes the hard coded sub-commands of 'tui reg' and instead
adds dynamic completion of sub-commands based on the architecturally
defined register groups, giving immediate access to all available
register groups.

There is still the 'next' and 'prev' commands for cycling through the
register groups if that's wanted.

The new code maintains the ability to only enter partial names for
register groups, which is something we got for free when using the
standard sub-command mechanism.

The register (and register group) completer has been changed to use
get_current_arch rather than using the architecture of the currently
selected frame.  When the target is running, this is equivalent,
however, when the target is not running, using get_current_arch will
provide results from the default architecture.

gdb/ChangeLog:

	* completer.c: Add arch-utils.h include.
	(enum reg_completer_targets): New enum.
	(reg_or_group_completer_1): New function containing old
	reg_or_group_completer, add and use new parameter to control what
	is completed on.  Use get_current_arch rather than architecture of
	currently selected frame.
	(reg_or_group_completer): Call new reg_or_group_completer_1.
	(reggroup_completer): Call new reg_or_group_completer_1.
	* completer.h (reggroup_completer): Add declaration.
	* tui/tui-regs.c: Add 'completer.h' include.
	(tui_reg_next_command): Renamed to...
	(tui_reg_next): ...this.  Adjust parameters and return rather than
	display new group.
	(tui_reg_prev_command): Renamed to...
	(tui_reg_prev): ...this.  Adjust parameters and return rather than
	display new group.
	(tui_reg_float_command): Delete.
	(tui_reg_general_command): Delete.
	(tui_reg_system_command): Delete.
	(tui_reg_command): Rewrite to perform switching of register group.
	Add header comment.
	(tuireglist): Remove.
	(tui_reggroup_completer): New function.
	(_initialize_tui_regs): Remove 'tui reg' sub-commands, update
	creation of 'tui reg' command.
	* NEWS: Add comment about 'tui reg' changes.

gdb/doc/ChangeLog:

	* gdb.texinfo (TUI Commands): Bring all 'tui reg' commands into a
	single table entry.
2015-06-13 21:28:53 +01:00
..
ChangeLog-1998-2003
tui-command.c Remove buggy xterm workaround in tui_dispatch_ctrl_char() 2015-05-14 08:18:06 -04:00
tui-command.h
tui-data.c gdb: Remove register class specific layout names. 2015-05-21 20:47:24 +02:00
tui-data.h gdb: Remove register class specific layout names. 2015-05-21 20:47:24 +02:00
tui-disasm.c Make type-safe the 'content' field of struct tui_gen_win_info 2015-04-27 21:19:53 -04:00
tui-disasm.h
tui-file.c
tui-file.h
tui-hooks.c
tui-hooks.h
tui-interp.c
tui-io.c
tui-io.h
tui-layout.c gdb: Add cleanup to avoid memory leak on error. 2015-05-21 20:49:00 +02:00
tui-layout.h gdb: Remove register class specific layout names. 2015-05-21 20:47:24 +02:00
tui-out.c
tui-regs.c gdb: Rework command completion on 'tui reg'. 2015-06-13 21:28:53 +01:00
tui-regs.h
tui-source.c TUI: avoid calling strcpy() on identical string objects 2015-04-27 21:19:58 -04:00
tui-source.h
tui-stack.c Make type-safe the 'content' field of struct tui_gen_win_info 2015-04-27 21:19:53 -04:00
tui-stack.h
tui-win.c Avoid race condition when handling a SIGWINCH signal 2015-05-13 11:53:28 -04:00
tui-win.h
tui-windata.c
tui-windata.h
tui-wingeneral.c
tui-wingeneral.h
tui-winsource.c Make type-safe the 'content' field of struct tui_gen_win_info 2015-04-27 21:19:53 -04:00
tui-winsource.h
tui.c gdb: New 'tui enable' and 'tui disable' commands. 2015-05-22 12:18:49 +02:00
tui.h gdb: Remove register class specific layout names. 2015-05-21 20:47:24 +02:00