]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* tuiWin.c (tui_update_gdb_sizes): New function to tell gdb what
authorStephane Carrez <stcarrez@nerim.fr>
Sat, 24 Aug 2002 16:43:08 +0000 (16:43 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Sat, 24 Aug 2002 16:43:08 +0000 (16:43 +0000)
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.

gdb/tui/ChangeLog
gdb/tui/tui.c
gdb/tui/tuiWin.c

index 01ac7d98b21d5affa3293983be4265c1fd5ab37a..32df100e77d4dbf188bd811e87bd0679b96416be 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-24  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * 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.
+
 2002-08-24  Stephane Carrez  <stcarrez@nerim.fr>
 
        * tui.c (tui_enable): Use tuiSetLayout instead of showLayout and
index 33232a50cdbeebfb7835fa6bb33c4bf3da8c673d..8ead02f5b0d09a2e6c67b3c551d5d4f6f83173af 100644 (file)
@@ -262,6 +262,7 @@ tui_enable (void)
   tui_version = 1;
   tui_active = 1;
   refresh ();
+  tui_update_gdb_sizes ();
 }
 
 /* Leave the tui mode.
@@ -286,6 +287,7 @@ tui_disable (void)
 
   tui_version = 0;
   tui_active = 0;
+  tui_update_gdb_sizes ();
 }
 
 /* Wrapper on top of free() to ensure that input address
index dccdcd7f8d5acf93ad89abc607b6160a5bc030bf..82c3d4951f40dc3e9002baec0cab67f7ed31cf8c 100644 (file)
@@ -52,6 +52,7 @@
 #include "breakpoint.h"
 #include "frame.h"
 #include "cli/cli-cmds.h"
+#include "top.h"
 
 #include "tui.h"
 #include "tuiData.h"
 #include "tuiSourceWin.h"
 #include "tuiDataWin.h"
 
-/*******************************
-** External Declarations
-********************************/
-extern void init_page_info ();
-
 /*******************************
 ** Static Local Decls
 ********************************/
@@ -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",