From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 705 invoked by alias); 15 Jun 2012 16:17:18 -0000 Received: (qmail 696 invoked by uid 22791); 15 Jun 2012 16:17:17 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_DW,TW_GD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jun 2012 16:17:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5FGH0nZ028340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jun 2012 12:17:00 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5FGGwAW010399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 15 Jun 2012 12:16:59 -0400 From: Tom Tromey To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: FYI: fix latent bug in dw2_find_symbol_file References: <87d3558zcz.fsf@fleche.redhat.com> Date: Fri, 15 Jun 2012 16:17:00 -0000 In-Reply-To: (Doug Evans's message of "Mon, 11 Jun 2012 13:49:54 -0700") Message-ID: <87sjdwsg79.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-06/txt/msg00511.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> You need to call init_cutu_and_read_dies in both debug-types and Doug> non-debug-types cases. Here's the patch I'm checking in. Doug patiently walked me through the setup. Thanks, Doug. For the record, you must: * Build the google/gcc-4_6 branch of gcc * Build CVS HEAD binutils and arrange for gold to be built and be the installed 'ld' * Run the test suite like so: runtest {C,CXX}FLAGS_FOR_TARGET='-g -gdwarf-4 -gfission -Wl,--gdb-index' GDB='../gdb --use-deprecated-index-sections' Even with this I couldn't see a regression, I think because I forgot to build the Objective C compiler (for the dwz branch, the failure that motivated the initial patch came from the gdb.objc). Doug showed me a simple reproducer, though, and I've incorporated this into the patch. Built and regtested on x86-64 Fedora 16. Tom 2012-06-15 Tom Tromey * dwarf2read.c (dw2_find_symbol_file): Unconditionally use init_cutu_and_read_dies. 2012-06-15 Tom Tromey * gdb.cp/namespace.exp: Add "show lang" test. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 1fdd819..a8cd158 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2906,12 +2906,8 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name) if (per_cu->v.quick->symtab != NULL) return per_cu->v.quick->symtab->filename; - if (per_cu->is_debug_types) - init_cutu_and_read_dies (per_cu, 0, 0, dw2_get_primary_filename_reader, - &filename); - else - init_cutu_and_read_dies_simple (per_cu, dw2_get_primary_filename_reader, - &filename); + init_cutu_and_read_dies (per_cu, 0, 0, dw2_get_primary_filename_reader, + &filename); return filename; } diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp index cf5a858..82018c6 100644 --- a/gdb/testsuite/gdb.cp/namespace.exp +++ b/gdb/testsuite/gdb.cp/namespace.exp @@ -66,6 +66,7 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} +gdb_test "show lang" "auto; currently c\\+\\+.*" # # set it up at a breakpoint so we can play with the variable values