From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20564 invoked by alias); 17 May 2011 17:01:18 -0000 Received: (qmail 20534 invoked by uid 22791); 17 May 2011 17:01:16 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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; Tue, 17 May 2011 17:00:58 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4HH0urw022123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 May 2011 13:00:56 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4HH0tKU030204; Tue, 17 May 2011 13:00:55 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p4HH0s6Q005454; Tue, 17 May 2011 13:00:55 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 4C480379188; Tue, 17 May 2011 11:00:53 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: Ulrich Weigand , gdb-patches@sourceware.org Subject: Re: gdbindex crash: Re: Regression: Re: RFC: implement typed DWARF stack References: <201105120003.p4C03V9u022585@d06av02.portsmouth.uk.ibm.com> <20110513075220.GA7000@host1.jankratochvil.net> <20110515082601.GA30005@host1.jankratochvil.net> Date: Tue, 17 May 2011 17:01:00 -0000 In-Reply-To: (Tom Tromey's message of "Mon, 16 May 2011 10:41:46 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-05/txt/msg00379.txt.bz2 Jan> The new testcase crashes with .gdb_index: Jan> print j Jan> ERROR: Process no longer exists Jan> UNRESOLVED: gdb.dwarf2/typeddwarf.exp: check value of j at typeddwarf.c:29 Tom> I have a patch for this which I'm going to test, Appended. I am checking this in. Earlier I did not realize that the types from the CU are cached, and so we can simply look them up using get_die_type_at_offset. Tom> but first I have to look into why the buildbot did not detect this. Tom> My guess is that the index-based tester is not working properly. I tracked this down to a bad 'make' invocation. It wasn't properly passing the options to set the compiler. I verified that it works now by examining the .log files and checking that dejagnu is invoking cc-with-index.sh. Tom 2011-05-17 Tom Tromey * dwarf2read.c (dwarf2_get_die_type): Call get_die_type_at_offset. * dwarf2expr.c (dwarf_get_base_type): Handle NULL return from get_base_type function. diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index 1fe8b79..5cd33a6 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -447,6 +447,8 @@ dwarf_get_base_type (struct dwarf_expr_context *ctx, ULONGEST die, int size) if (ctx->get_base_type) { result = ctx->get_base_type (ctx, die); + if (result == NULL) + error (_("Could not find type for DW_OP_GNU_const_type")); if (size != 0 && TYPE_LENGTH (result) != size) error (_("DW_OP_GNU_const_type has different sizes for type and data")); } diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 22643c5..6558bfe 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -13671,22 +13671,8 @@ struct type * dwarf2_get_die_type (unsigned int die_offset, struct dwarf2_per_cu_data *per_cu) { - struct dwarf2_cu *cu = per_cu->cu; - struct die_info *die; - struct type *result; - dw2_setup (per_cu->objfile); - - die = follow_die_offset (die_offset, &cu); - if (!die) - error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"), - die_offset, per_cu->cu->objfile->name); - - result = get_die_type (die, cu); - if (result == NULL) - result = read_type_die_1 (die, cu); - - return result; + return get_die_type_at_offset (die_offset, per_cu); } /* Follow the signature attribute ATTR in SRC_DIE.