From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18678 invoked by alias); 28 Mar 2004 10:19:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18586 invoked from network); 28 Mar 2004 10:19:57 -0000 Received: from unknown (HELO kraid.nerim.net) (62.4.16.100) by sources.redhat.com with SMTP; 28 Mar 2004 10:19:57 -0000 Received: from nerim.fr (stcarrez.net1.nerim.net [62.212.108.40]) by kraid.nerim.net (Postfix) with ESMTP id 9F4FF40F13; Sun, 28 Mar 2004 12:19:55 +0200 (CEST) Message-ID: <4066A6C6.2010500@nerim.fr> Date: Sun, 28 Mar 2004 10:19:00 -0000 From: Stephane Carrez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [PATCH]: Fix crash when using 'tui reg' in non-tui mode X-Enigmail-Version: 0.76.8.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3CFAA8059DBAB704BD099755" X-SW-Source: 2004-03/txt/msg00700.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3CFAA8059DBAB704BD099755 Content-Type: multipart/mixed; boundary="------------010108010803000901020502" This is a multi-part message in MIME format. --------------010108010803000901020502 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 451 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 * tui/tui-regs.c (tui_show_registers): Make sure the TUI is active and switch the layout to force a display of register window. --------------010108010803000901020502 Content-Type: text/plain; name="tui-regs.c.diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tui-regs.c.diffs" Content-length: 928 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; --------------010108010803000901020502-- --------------enig3CFAA8059DBAB704BD099755 Content-Type: application/pgp-signature Content-length: 253 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org iD8DBQFAZqbLNyQxO2LzKT0RAqOJAKCoAnbxD4dWg1u/bNiHWUwBcC/4fQCgwb/6 NWtfobIwuUBP8yD32oUsqI0= =V2bm -----END PGP SIGNATURE----- --------------enig3CFAA8059DBAB704BD099755--