aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-04-23 18:31:38 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-04-28 08:46:28 -0400
commitd6e5e7f7fd90baad9cbfaa5a187b5f0b1a0b8cf6 (patch)
tree47a4511a2f7106e5e3ce6e2fa7766aed2e6c45f4 /gdb/tui
parentff862be47e7acf51e4abaf0f121d5961adb1845a (diff)
downloadbinutils-d6e5e7f7fd90baad9cbfaa5a187b5f0b1a0b8cf6.zip
binutils-d6e5e7f7fd90baad9cbfaa5a187b5f0b1a0b8cf6.tar.gz
binutils-d6e5e7f7fd90baad9cbfaa5a187b5f0b1a0b8cf6.tar.bz2
Introduce function for directly updating GDB's screen dimensions
... to replace the roundabout pattern of execute_command ("set width %d"); execute_command ("set height %d"); for doing the same thing. gdb/ChangeLog: * utils.h (set_screen_width_and_height): Declare. * utils.c (set_screen_width_and_height): Define. * tui/tui-win.c (tui_update_gdb_sizes): Use it.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-win.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 3cf38fc..6830977 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -465,15 +465,20 @@ bold-standout use extra bright or bold with standout mode"),
void
tui_update_gdb_sizes (void)
{
- char cmd[50];
-
- /* Set to TUI command window dimension or use readline values. */
- xsnprintf (cmd, sizeof (cmd), "set width %d",
- tui_active ? TUI_CMD_WIN->generic.width : tui_term_width());
- execute_command (cmd, 0);
- xsnprintf (cmd, sizeof (cmd), "set height %d",
- tui_active ? TUI_CMD_WIN->generic.height : tui_term_height());
- execute_command (cmd, 0);
+ int width, height;
+
+ if (tui_active)
+ {
+ width = TUI_CMD_WIN->generic.width;
+ height = TUI_CMD_WIN->generic.height;
+ }
+ else
+ {
+ width = tui_term_width ();
+ height = tui_term_height ();
+ }
+
+ set_screen_width_and_height (width, height);
}