From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18133 invoked by alias); 18 Nov 2005 16:20:31 -0000 Received: (qmail 18121 invoked by uid 22791); 18 Nov 2005 16:20:28 -0000 Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 18 Nov 2005 16:20:28 +0000 Received: from fra-out-01.spheriq.net (fra-out-01.spheriq.net [195.46.51.129]) by fra-del-04.spheriq.net with ESMTP id jAIGKNW9008540 for ; Fri, 18 Nov 2005 16:20:23 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-01.spheriq.net with ESMTP id jAIGKGTu031240 for ; Fri, 18 Nov 2005 16:20:18 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id jAIGK8O1024877 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 18 Nov 2005 16:20:10 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 75563DA4A; Fri, 18 Nov 2005 16:20:07 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id E2A844746F; Fri, 18 Nov 2005 16:23:06 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 26A977599D; Fri, 18 Nov 2005 16:23:06 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 51DF94747B; Fri, 18 Nov 2005 16:23:05 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CGZ55475 (AUTH "andrew stubbs"); Fri, 18 Nov 2005 16:20:04 GMT Message-ID: <437DFE96.9050606@st.com> Date: Fri, 18 Nov 2005 17:33:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: MI problem References: <4378DDB4.3020702@st.com> <20051117042008.GE3513@nevyn.them.org> <437CD72D.70104@st.com> <20051118155426.GB9846@nevyn.them.org> In-Reply-To: <20051118155426.GB9846@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------070303060103010808040801" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00336.txt.bz2 This is a multi-part message in MIME format. --------------070303060103010808040801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 320 > How about we commit this without the current_interp_named_p change for > now? Normally we'd need to use a cleanup to save and restore uiout, > but nothing here can throw exceptions AFAICT, so we're OK with the way > you've done it. OK, I'm happy to do that. Am I OK to commit the attached to both branches? Andrew --------------070303060103010808040801 Content-Type: text/plain; name="mi-load-crash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mi-load-crash.patch" Content-length: 1270 2005-11-18 Andrew Stubbs * mi/mi-main.c (mi_load_progress): Ensure the use of the correct mi uiout for the duration of the function. Index: src/gdb/mi/mi-main.c =================================================================== --- src.orig/gdb/mi/mi-main.c 2005-11-17 19:47:42.000000000 +0000 +++ src/gdb/mi/mi-main.c 2005-11-18 16:16:38.000000000 +0000 @@ -1365,9 +1365,18 @@ mi_load_progress (const char *section_na static struct timeval last_update; static char *previous_sect_name = NULL; int new_section; + struct ui_out *saved_uiout; - if (!current_interp_named_p (INTERP_MI) - && !current_interp_named_p (INTERP_MI1)) + /* This function is called through deprecated_show_load_progress + which means uiout may not be correct. Fix it for the duration + of this function. */ + saved_uiout = uiout; + + if (current_interp_named_p (INTERP_MI)) + uiout = mi_out_new (2); + else if (current_interp_named_p (INTERP_MI1)) + uiout = mi_out_new (1); + else return; update_threshold.tv_sec = 0; @@ -1424,6 +1433,9 @@ mi_load_progress (const char *section_na fputs_unfiltered ("\n", raw_stdout); gdb_flush (raw_stdout); } + + xfree (uiout); + uiout = saved_uiout; } void --------------070303060103010808040801--