From d6e5e7f7fd90baad9cbfaa5a187b5f0b1a0b8cf6 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Thu, 23 Apr 2015 18:31:38 -0400 Subject: 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. --- gdb/utils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gdb/utils.c') diff --git a/gdb/utils.c b/gdb/utils.c index a9350d9..70708bf 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1795,6 +1795,18 @@ set_height_command (char *args, int from_tty, struct cmd_list_element *c) set_screen_size (); } +/* See utils.h. */ + +void +set_screen_width_and_height (int width, int height) +{ + lines_per_page = height; + chars_per_line = width; + + set_screen_size (); + set_width (); +} + /* Wait, so the user can read what's on the screen. Prompt the user to continue by pressing RETURN. */ -- cgit v1.1