This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix crash when using 'tui reg' in non-tui mode


Hi!

This patch fixes a crash when 'tui reg' commands are used in the non-tui mode.  Following
the 'layout' and other tui specific commands, it now switches to the tui mode and makes sure
the tui register window is visible.

Committed on 6_1 and mainline.

Stephane

2004-03-28 Stephane Carrez <stcarrez@nerim.fr>

	* tui/tui-regs.c (tui_show_registers): Make sure the TUI is active
	and switch the layout to force a display of register window.

Index: tui/tui-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-regs.c,v
retrieving revision 1.12.2.1
diff -u -p -r1.12.2.1 tui-regs.c
--- tui/tui-regs.c	13 Mar 2004 14:21:00 -0000	1.12.2.1
+++ tui/tui-regs.c	28 Mar 2004 10:14:39 -0000
@@ -148,8 +148,17 @@ void
 tui_show_registers (struct reggroup *group)
 {
   enum tui_status ret = TUI_FAILURE;
-  struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
+  struct tui_data_info *display_info;
 
+  /* Make sure the curses mode is enabled.  */
+  tui_enable ();
+
+  /* Make sure the register window is visible.  If not, select an
+     appropriate layout.  */
+  if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
+    tui_set_layout_for_display_command (DATA_NAME);
+
+  display_info = &TUI_DATA_WIN->detail.data_display_info;
   if (group == 0)
     group = general_reggroup;
 

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]