Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stephane Carrez <stcarrez@nerim.fr>
To: gdb-patches@sources.redhat.com
Subject: [PATCH]: Fix crash when using 'tui reg' in non-tui mode
Date: Sun, 28 Mar 2004 10:19:00 -0000	[thread overview]
Message-ID: <4066A6C6.2010500@nerim.fr> (raw)


[-- 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 --]

             reply	other threads:[~2004-03-28 10:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-28 10:19 Stephane Carrez [this message]
2004-03-28 19:36 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4066A6C6.2010500@nerim.fr \
    --to=stcarrez@nerim.fr \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox