Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH]: Fix crash when using 'tui reg' in non-tui mode
@ 2004-03-28 10:19 Stephane Carrez
  2004-03-28 19:36 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Carrez @ 2004-03-28 10:19 UTC (permalink / raw)
  To: gdb-patches


[-- Attachment #1.1: Type: text/plain, Size: 451 bytes --]

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.


[-- Attachment #1.2: tui-regs.c.diffs --]
[-- Type: text/plain, Size: 928 bytes --]

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 #2: Type: application/pgp-signature, Size: 253 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-28 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-28 10:19 [PATCH]: Fix crash when using 'tui reg' in non-tui mode Stephane Carrez
2004-03-28 19:36 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox