From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24577 invoked by alias); 7 Mar 2012 18:57:51 -0000 Received: (qmail 24564 invoked by uid 22791); 7 Mar 2012 18:57:50 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Mar 2012 18:57:37 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AFC4F1C6A27; Wed, 7 Mar 2012 13:57:36 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id A986d00ICDYT; Wed, 7 Mar 2012 13:57:36 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 71B341C6A0D; Wed, 7 Mar 2012 13:57:36 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id D121E145615; Wed, 7 Mar 2012 10:57:30 -0800 (PST) Date: Wed, 07 Mar 2012 18:57:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix CU relative vs. absolute offsets [Re: RFC: problem with DW_OP_GNU_deref_type and dwarf's get_base_type callback] Message-ID: <20120307185730.GQ2853@adacore.com> References: <20120305223429.GM2867@adacore.com> <20120307170940.GA22619@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120307170940.GA22619@host2.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) 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-03/txt/msg00235.txt.bz2 > I do not understand how it can happen. amd64-entry-value.exp uses precompiled > amd64-entry-value.s (unless you use runtest COMPILE=1) and sure it fully > PASSed+PASSes for me. I did not run with COMPILE=1, so I think what might be happening is that the linker might be putting your pre-compiled CU first? > It looks as if some of the GDB features have never worked in real world - just > in the testcase which have single CU. :-) That was my guess first I first saw the testcase using them in our testsuite. But then, I saw that we do a link, so I thought for sure we have multi-CU exes. But maybe we used to get lucky as explained in the total blind guess above? > 2012-03-07 Jan Kratochvil > > Fix CU relative vs. absolute DIE offsets. > * dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter > offset to offset_in_cu. > * dwarf2read.c (process_enumeration_scope): Add CU offset to > TYPE_OFFSET. > (dwarf2_fetch_die_location_block): Rename parameter offset to > offset_in_cu. New variable offset, add CU offset to OFFSET_IN_CU. > > --- a/gdb/dwarf2loc.h > +++ b/gdb/dwarf2loc.h > @@ -61,7 +61,7 @@ const gdb_byte *dwarf2_find_location_expression > CORE_ADDR pc); > > struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block > - (unsigned int offset, struct dwarf2_per_cu_data *per_cu, > + (unsigned int offset_in_cu, struct dwarf2_per_cu_data *per_cu, > CORE_ADDR (*get_frame_pc) (void *baton), > void *baton); I like these renames... I don't really know the code well enough to give an opinion on the correctness of the patch, though. I can test them against our version of GCC 4.7. Will do that and report. -- Joel