From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23466 invoked by alias); 25 Nov 2002 21:20: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 23428 invoked from network); 25 Nov 2002 21:20:56 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 25 Nov 2002 21:20:56 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id AEAD83E66; Mon, 25 Nov 2002 16:20:52 -0500 (EST) Message-ID: <3DE29434.2090205@redhat.com> Date: Mon, 25 Nov 2002 13:20:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jim Blandy , Elena Zannoni Cc: David Carlton , gdb-patches@sources.redhat.com Subject: Re: [rfa+5.3] bug in my earlier DW_TAG_namespace patch References: Content-Type: multipart/mixed; boundary="------------020704090405000102010409" X-SW-Source: 2002-11/txt/msg00610.txt.bz2 This is a multi-part message in MIME format. --------------020704090405000102010409 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 226 Hello, David recommended this for: ####### ##### # # # # # ###### ##### # ### # # # ### # # ##### ### #### any comments? Andrew --------------020704090405000102010409 Content-Type: message/rfc822; name="mailbox-message://ac131313@movemail/fsf/gdb/patches#10783294" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mailbox-message://ac131313@movemail/fsf/gdb/patches#10783294" Content-length: 4374 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: ac131313@localhost.redhat.com Received: from localhost (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6FDFF3E4B for ; Thu, 21 Nov 2002 19:31:18 -0500 (EST) Envelope-to: cagney@gnu.org Delivery-date: Thu, 21 Nov 2002 19:26:30 -0500 Received: from fencepost.gnu.org by localhost with IMAP (fetchmail-5.9.13) for ac131313@localhost (single-drop); Thu, 21 Nov 2002 19:31:18 -0500 (EST) Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.10) id 18F1eQ-000543-01 for cagney@gnu.org; Thu, 21 Nov 2002 19:26:30 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18F1eN-0002hp-00 for cagney@gnu.org; Thu, 21 Nov 2002 19:26:29 -0500 Received: from sources.redhat.com ([209.249.29.67]) by monty-python.gnu.org with smtp (Exim 4.10) id 18F1eM-0002gQ-00 for cagney@gnu.org; Thu, 21 Nov 2002 19:26:27 -0500 Received: (qmail 16351 invoked by alias); 22 Nov 2002 00:26:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Delivered-To: mailing list gdb-patches@sources.redhat.com Received: (qmail 16344 invoked from network); 22 Nov 2002 00:26:24 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 22 Nov 2002 00:26:24 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id gAM0QNX22420; Thu, 21 Nov 2002 16:26:23 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Cc: Jim Blandy , Elena Zannoni Subject: [rfa+5.3] bug in my earlier DW_TAG_namespace patch From: David Carlton Date: 21 Nov 2002 16:26:22 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Status: No, hits=-0.3 required=5.0 tests=SPAM_PHRASE_00_01,X_AUTH_WARNING version=2.41 X-Spam-Level: Content-length: 1806 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? 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) { --------------020704090405000102010409--