From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16909 invoked by alias); 2 Dec 2005 11:18:54 -0000 Received: (qmail 16901 invoked by uid 22791); 2 Dec 2005 11:18:53 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 Dec 2005 11:18:51 +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 jB2BIlD9028466 for ; Fri, 2 Dec 2005 11:18:47 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-01.spheriq.net with ESMTP id jB2BIiDt030361 for ; Fri, 2 Dec 2005 11:18:45 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id jB2BIhpD028793 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 2 Dec 2005 11:18:44 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 F1B62DA76; Fri, 2 Dec 2005 11:18:00 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 4F3DA473B9; Fri, 2 Dec 2005 11:21:03 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EEC0F75994; Fri, 2 Dec 2005 11:21:02 +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 51B86473B6; Fri, 2 Dec 2005 11:21:02 +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 CHA54211 (AUTH "andrew stubbs"); Fri, 2 Dec 2005 11:17:55 GMT Message-ID: <43902CD9.5090007@st.com> Date: Fri, 02 Dec 2005 11:48:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Jim Blandy Cc: GDB Patches Subject: Re: [PATCH] fix symbol-file crash References: <438F3A67.1070700@st.com> <8f2776cb0512011713h6afa848ag9f0fd9dfbca0efcc@mail.gmail.com> In-Reply-To: <8f2776cb0512011713h6afa848ag9f0fd9dfbca0efcc@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------070803010605030507060404" 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.2.0 X-IsSubscribed: yes 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-12/txt/msg00045.txt.bz2 This is a multi-part message in MIME format. --------------070803010605030507060404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 296 Jim Blandy wrote: > I think this is obvious; please go ahead and commit it. > > However, instead of using when symfile_objfile is NULL, just > use two distinct prompt strings: "Discard symbol table from `%s'? " > and "Discard symbol table? ". Thanks I committed the attached. Andrew --------------070803010605030507060404 Content-Type: text/plain; name="symbol-file.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="symbol-file.patch" Content-length: 817 2005-12-02 Andrew Stubbs * symfile.c (symbol_file_clear): Test symfile_objfile is not NULL before dereferencing it. Gettextize the query. Index: src/gdb/symfile.c =================================================================== --- src.orig/gdb/symfile.c 2005-12-01 17:35:14.000000000 +0000 +++ src/gdb/symfile.c 2005-12-02 10:49:45.000000000 +0000 @@ -1085,8 +1085,10 @@ symbol_file_clear (int from_tty) { if ((have_full_symbols () || have_partial_symbols ()) && from_tty - && !query ("Discard symbol table from `%s'? ", - symfile_objfile->name)) + && (symfile_objfile + ? !query (_("Discard symbol table from `%s'? "), + symfile_objfile->name) + : !query (_("Discard symbol table? ")))) error (_("Not confirmed.")); free_all_objfiles (); --------------070803010605030507060404--