aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tuiWin.c
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-08-24 16:43:08 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-08-24 16:43:08 +0000
commit3e752b0491df868a89f370a136a0edb94c5081f5 (patch)
tree9a0751f17bcf9158492e9a5a9bcbca6ddff74397 /gdb/tui/tuiWin.c
parentc7037be10d946a1e11e3e30d7fc82656fa17aa93 (diff)
downloadgdb-3e752b0491df868a89f370a136a0edb94c5081f5.zip
gdb-3e752b0491df868a89f370a136a0edb94c5081f5.tar.gz
gdb-3e752b0491df868a89f370a136a0edb94c5081f5.tar.bz2
* tuiWin.c (tui_update_gdb_sizes): New function to tell gdb what
is the size of command window. (tuiResizeAll): Call it instead of init_page_info. * tui.c (tui_enable): Call it to resize to TUI command window. (tui_disable): Likewise for plain screen.
Diffstat (limited to 'gdb/tui/tuiWin.c')
-rw-r--r--gdb/tui/tuiWin.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c
index dccdcd7..82c3d49 100644
--- a/gdb/tui/tuiWin.c
+++ b/gdb/tui/tuiWin.c
@@ -52,6 +52,7 @@
#include "breakpoint.h"
#include "frame.h"
#include "cli/cli-cmds.h"
+#include "top.h"
#include "tui.h"
#include "tuiData.h"
@@ -64,11 +65,6 @@
#include "tuiDataWin.h"
/*******************************
-** External Declarations
-********************************/
-extern void init_page_info ();
-
-/*******************************
** Static Local Decls
********************************/
static void _makeVisibleWithNewHeight (TuiWinInfoPtr);
@@ -396,6 +392,22 @@ Usage: w <#lines>\n");
add_show_from_set (c, &tui_showlist);
}
+/* Update gdb's knowledge of the terminal size. */
+void
+tui_update_gdb_sizes ()
+{
+ char cmd[50];
+ extern int screenheight, screenwidth; /* in readline */
+
+ /* Set to TUI command window dimension or use readline values. */
+ sprintf (cmd, "set width %d",
+ tui_active ? cmdWin->generic.width : screenwidth);
+ execute_command (cmd, 0);
+ sprintf (cmd, "set height %d",
+ tui_active ? cmdWin->generic.height : screenheight);
+ execute_command (cmd, 0);
+}
+
/*
** tuiSetWinFocusTo
@@ -618,7 +630,7 @@ tuiResizeAll (void)
/* turn keypad off while we resize */
if (winWithFocus != cmdWin)
keypad (cmdWin->generic.handle, FALSE);
- init_page_info ();
+ tui_update_gdb_sizes ();
setTermHeightTo (screenheight);
setTermWidthTo (screenwidth);
if (curLayout == SRC_DISASSEM_COMMAND ||
@@ -1039,7 +1051,7 @@ The window name specified must be valid and visible.\n");
warning ("Invalid window height specified.\n%s",
WIN_HEIGHT_USAGE);
else
- init_page_info ();
+ tui_update_gdb_sizes ();
}
else
warning ("Invalid window height specified.\n%s",