From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2826 invoked by alias); 25 Nov 2002 21:37:27 -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 2799 invoked from network); 25 Nov 2002 21:37:26 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 25 Nov 2002 21:37:26 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gAPLD5P03409 for ; Mon, 25 Nov 2002 16:13:05 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gAPLbPD15890; Mon, 25 Nov 2002 16:37:25 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gAPLbOw02425; Mon, 25 Nov 2002 16:37:24 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 5751CFF79; Mon, 25 Nov 2002 16:33:09 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15842.38677.146754.12091@localhost.redhat.com> Date: Mon, 25 Nov 2002 13:37:00 -0000 To: Andrew Cagney Cc: Jim Blandy , Elena Zannoni , David Carlton , gdb-patches@sources.redhat.com Subject: Re: [rfa+5.3] bug in my earlier DW_TAG_namespace patch In-Reply-To: <3DE29434.2090205@redhat.com> References: <3DE29434.2090205@redhat.com> X-SW-Source: 2002-11/txt/msg00614.txt.bz2 Andrew Cagney writes: > Hello, > > David recommended this for: > > ####### ##### > # # # > # # > ###### ##### > # ### # > # # ### # # > ##### ### #### > > any comments? > I knew I was forgetting something. > I just noticed that my earlier patch that allowed GDB to accept > DW_TAG_namespace entries had a bug in it. The function > scan_partial_symbols in dwarf2read.c only descends into DIEs that have > a name; but anonymous namespaces can lead to DIEs without names which > have interesting children (where by "interesting" I mean that we want > to add partial symbols corresponding to them). This could result in > us missing some partial symbols. > > I've enclosed a patch below: for obvious reasons, it should go into > GDB 5.3 as well. I've run GDB on a copy of GDB with this patch > applied and followed the control flow when GDB runs into various sorts > of DW_TAG_namespace entries, and the control flow seems to behave like > I expect it to. (This is, admittedly, after only a limited amount of > testing.) I'm in the middle of running the testsuite (I'll run it > twice, once on a compiler that doesn't generate DW_TAG_namespace > entries and once on a compiler that does); assuming that there are no > new regressions, is the patch okay? Were there regressions? If not, go ahead. Elena > > David Carlton > carlton@math.stanford.edu > > 2002-11-21 David Carlton > > * dwarf2read.c (scan_partial_symbols): Descend into namespace > pdi's with no name. > > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.75 > diff -u -p -r1.75 dwarf2read.c > --- dwarf2read.c 11 Nov 2002 00:55:34 -0000 1.75 > +++ dwarf2read.c 22 Nov 2002 00:11:49 -0000 > @@ -1359,7 +1359,9 @@ scan_partial_symbols (char *info_ptr, st > { > info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header); > > - if (pdi.name) > + /* Anonymous namespaces have no name but are interesting. */ > + > + if (pdi.name != NULL || pdi.tag == DW_TAG_namespace) > { > switch (pdi.tag) > { >