From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9938 invoked by alias); 12 Jul 2010 19:47:48 -0000 Received: (qmail 9930 invoked by uid 22791); 12 Jul 2010 19:47:48 -0000 X-SWARE-Spam-Status: No, hits=-5.9 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 19:47:43 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6CJlgTn029265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jul 2010 15:47:42 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6CJleKn011212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Jul 2010 15:47:41 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o6CJldDO007250; Mon, 12 Jul 2010 21:47:39 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o6CJlcnO007249; Mon, 12 Jul 2010 21:47:38 +0200 Date: Mon, 12 Jul 2010 19:47:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: fix bug when debugging prelink'd library Message-ID: <20100712194738.GA6846@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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/msg00216.txt.bz2 On Mon, 12 Jul 2010 21:34:20 +0200, Tom Tromey wrote: > This fixes the problem by changing dwarf2_per_cu_objfile to return the > debuginfo objfile. This appears to be correct for all callers except > one, which I also updated. As I find the API difficult to figure out which variant of `struct objfile *' there is I tried to unify it - choosing the variant (A) described at: [patch 12/15] PIE: Support loading PIEs from core files http://sourceware.org/ml/gdb-patches/2009-11/msg00179.html The patch below follows none of the (A)/(B)/(C) rules. In such case I miss at least some fat comment at dwarf2_per_cu_objfile stating it returns non-primary objfile variant. dwarf2_per_cu_objfile result is in most cases used only for get_objfile_arch (should not matter) and CORE_ADDR base_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); so there could be rather function dwarf2_per_cu_base_offset. Regards, Jan