From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11445 invoked by alias); 12 Jul 2010 20:24:56 -0000 Received: (qmail 11437 invoked by uid 22791); 12 Jul 2010 20:24:55 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,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; Mon, 12 Jul 2010 20:24:50 +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.13.8/8.13.8) with ESMTP id o6CKOnBv015326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jul 2010 16:24:49 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6CKOmQm014254; Mon, 12 Jul 2010 16:24:49 -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 o6CKOmrP025619; Mon, 12 Jul 2010 16:24:48 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id CA02B3782A3; Mon, 12 Jul 2010 14:24:47 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: RFC: fix bug when debugging prelink'd library References: <20100712194738.GA6846@host0.dyn.jankratochvil.net> Date: Mon, 12 Jul 2010 20:24:00 -0000 In-Reply-To: <20100712194738.GA6846@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Mon, 12 Jul 2010 21:47:38 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2010-07/txt/msg00217.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Tom> This fixes the problem by changing dwarf2_per_cu_objfile to return the Tom> debuginfo objfile. This appears to be correct for all callers except Tom> one, which I also updated. Jan> As I find the API difficult to figure out which variant of `struct Jan> objfile *' there is I tried to unify it - choosing the variant (A) Jan> described at: Jan> [patch 12/15] PIE: Support loading PIEs from core files Jan> http://sourceware.org/ml/gdb-patches/2009-11/msg00179.html I agree that one of these approaches is good for generic code in gdb. (Actually -- I would much prefer a different design, where there is no ambiguity possible. But that seems like a big refactoring without a big user-visible benefit.) Jan> In such case I miss at least some fat comment at Jan> dwarf2_per_cu_objfile stating it returns non-primary objfile Jan> variant. I will do that. Jan> dwarf2_per_cu_objfile result is in most cases used only for Jan> get_objfile_arch (should not matter) and Jan> CORE_ADDR base_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); Jan> so there could be rather function dwarf2_per_cu_base_offset. Actually, I think I will do this. It does mean we need 3 new accessors, which is ugly. OTOH, I found that we use the objfile's name in locexpr_describe_location_piece, and there I think we also want the master objfile. Tom