From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30511 invoked by alias); 20 Oct 2011 20:40:43 -0000 Received: (qmail 30500 invoked by uid 22791); 20 Oct 2011 20:40:41 -0000 X-SWARE-Spam-Status: No, hits=2.5 required=5.0 tests=AWL,BAYES_50,KAM_STOCKTIP,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Oct 2011 20:40:27 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RGzPb-0002ua-3L for gdb-patches@sources.redhat.com; Thu, 20 Oct 2011 22:40:23 +0200 Received: from 209.226.137.108 ([209.226.137.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Oct 2011 22:40:23 +0200 Received: from aristovski by 209.226.137.108 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Oct 2011 22:40:23 +0200 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] gdb crash in cp_scan_for_anonymous_namespace Date: Thu, 20 Oct 2011 20:41:00 -0000 Message-ID: References: <4EA0808B.3040209@qnx.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060206010502070400030004" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110923 Thunderbird/7.0 In-Reply-To: <4EA0808B.3040209@qnx.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00578.txt.bz2 This is a multi-part message in MIME format. --------------060206010502070400030004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 494 On 11-10-20 04:11 PM, Aleksandar Ristovski wrote: > On 11-10-20 03:46 PM, Tom Tromey wrote: >> Ok. >> >> Tom > > This is now committed: > http://sourceware.org/ml/gdb-cvs/2011-10/msg00154.html > > Thank you for the quick review, > > Aleksandar > Just for completeness sake, here is gdb_7_3-branch patch (the HEAD one does not cleanly apply, though it is trivial to merge). Not sure if you want this committed, or just left here for reference, I don't mind either way. Thanks, Aleksandar --------------060206010502070400030004 Content-Type: text/x-patch; name="GDBCRASH-no-symtab-201110201358-gdb_7_3-branch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="GDBCRASH-no-symtab-201110201358-gdb_7_3-branch.patch" Content-length: 4071 Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.12887.2.72 diff -u -p -r1.12887.2.72 ChangeLog --- gdb/ChangeLog 4 Sep 2011 19:11:26 -0000 1.12887.2.72 +++ gdb/ChangeLog 20 Oct 2011 20:29:18 -0000 @@ -1,3 +1,15 @@ +2011-10-20 Aleksandar Ristovski + + * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function + arguments by adding OBJFILE. Instead of getting objfile from + symbol's symtab, use new argument OBJFILE. + * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function + arguments by adding OBJFILE. + * gdb/dwarf2read.c (new_symbol_full): Change call to + cp_scan_for_anonymous_namespaces to match new signature. + * gdb/stabsread.c (define_symbol): Change call to + cp_scan_for_anonymous_namespaces to match new signature. + 2011-09-04 Joel Brobecker * version.in: Set version to 7.3.1.20110904-cvs. Index: gdb/cp-namespace.c =================================================================== RCS file: /cvs/src/src/gdb/cp-namespace.c,v retrieving revision 1.49.2.1 diff -u -p -r1.49.2.1 cp-namespace.c --- gdb/cp-namespace.c 2 Jul 2011 19:37:21 -0000 1.49.2.1 +++ gdb/cp-namespace.c 20 Oct 2011 20:29:18 -0000 @@ -71,7 +71,8 @@ static void maintenance_cplus_namespace anonymous namespace; if so, add an appropriate using directive. */ void -cp_scan_for_anonymous_namespaces (const struct symbol *symbol) +cp_scan_for_anonymous_namespaces (const struct symbol *const symbol, + struct objfile *const objfile) { if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) { @@ -114,7 +115,7 @@ cp_scan_for_anonymous_namespaces (const namespace given by the previous component if there is one, or to the global namespace if there isn't. */ cp_add_using_directive (dest, src, NULL, NULL, - &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack); + &objfile->objfile_obstack); } /* The "+ 2" is for the "::". */ previous_component = next_component + 2; Index: gdb/cp-support.h =================================================================== RCS file: /cvs/src/src/gdb/cp-support.h,v retrieving revision 1.41.2.1 diff -u -p -r1.41.2.1 cp-support.h --- gdb/cp-support.h 2 Jul 2011 19:37:21 -0000 1.41.2.1 +++ gdb/cp-support.h 20 Oct 2011 20:29:19 -0000 @@ -153,7 +153,8 @@ extern void cp_set_block_scope (const st const char *processing_current_prefix, int processing_has_namespace_info); -extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); +extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol, + struct objfile *objfile); extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, const struct block *block, Index: gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.518.2.9 diff -u -p -r1.518.2.9 dwarf2read.c --- gdb/dwarf2read.c 12 Jul 2011 21:12:56 -0000 1.518.2.9 +++ gdb/dwarf2read.c 20 Oct 2011 20:29:20 -0000 @@ -11445,7 +11445,7 @@ new_symbol_full (struct die_info *die, s namespaces based on the demangled name. */ if (!processing_has_namespace_info && cu->language == language_cplus) - cp_scan_for_anonymous_namespaces (sym); + cp_scan_for_anonymous_namespaces (sym, objfile); } return (sym); } Index: gdb/stabsread.c =================================================================== RCS file: /cvs/src/src/gdb/stabsread.c,v retrieving revision 1.137 diff -u -p -r1.137 stabsread.c --- gdb/stabsread.c 15 Mar 2011 17:54:27 -0000 1.137 +++ gdb/stabsread.c 20 Oct 2011 20:29:20 -0000 @@ -729,7 +729,7 @@ define_symbol (CORE_ADDR valu, char *str SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile); if (SYMBOL_LANGUAGE (sym) == language_cplus) - cp_scan_for_anonymous_namespaces (sym); + cp_scan_for_anonymous_namespaces (sym, objfile); } p++; --------------060206010502070400030004--