aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-05-21 21:51:53 +0200
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-05-26 22:18:50 +0100
commit55b400279267cad460ca62a8211f0b414f564e93 (patch)
tree9a86945461e96428aae5ac7b9a6266d632c8e614 /gdb/tui
parent7e16ef34742d853239608fadde4a19f3a105b0a2 (diff)
downloadbinutils-55b400279267cad460ca62a8211f0b414f564e93.zip
binutils-55b400279267cad460ca62a8211f0b414f564e93.tar.gz
binutils-55b400279267cad460ca62a8211f0b414f564e93.tar.bz2
gdb: Add 'tui reg prev' command.
There is already a 'tui reg next' command, this adds a symmetric 'tui reg prev' command. gdb/ChangeLog: * tui/tui-regs.c (tui_reg_prev_command): New function. (_initialize_tui_regs): Add 'prev' command for 'tui reg'. * reggroups.c (reggroup_prev): New function. * reggroups.h (reggroup_prev): Add declaration. Update comment. gdb/doc/ChangeLog: * gdb.texinfo (TUI Commands): Add 'tui reg prev' details.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-regs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 8d4c0f8..7cf386d 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -575,6 +575,29 @@ tui_reg_next_command (char *arg, int from_tty)
}
}
+/* Implementation of the "tui reg prev" command. Cycle the register group
+ displayed in the tui REG window, moving backwards through the list of
+ available register groups. */
+
+static void
+tui_reg_prev_command (char *arg, int from_tty)
+{
+ struct gdbarch *gdbarch = get_current_arch ();
+
+ if (TUI_DATA_WIN != NULL)
+ {
+ struct reggroup *group
+ = TUI_DATA_WIN->detail.data_display_info.current_group;
+
+ group = reggroup_prev (gdbarch, group);
+ if (group == NULL)
+ group = reggroup_prev (gdbarch, NULL);
+
+ if (group != NULL)
+ tui_show_registers (group);
+ }
+}
+
static void
tui_reg_float_command (char *arg, int from_tty)
{
@@ -630,6 +653,9 @@ _initialize_tui_regs (void)
add_cmd ("next", class_tui, tui_reg_next_command,
_("Display next register group."),
&tuireglist);
+ add_cmd ("prev", class_tui, tui_reg_prev_command,
+ _("Display previous register group."),
+ &tuireglist);
}