From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19398 invoked by alias); 24 Jul 2006 20:05:02 -0000 Received: (qmail 19390 invoked by uid 22791); 24 Jul 2006 20:05:02 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 24 Jul 2006 20:05:00 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G56fh-0004Aq-RI; Mon, 24 Jul 2006 16:04:57 -0400 Date: Mon, 24 Jul 2006 20:05:00 -0000 From: Daniel Jacobowitz To: Frederic RISS Cc: gdb-patches@sources.redhat.com, Steven Johnson Subject: Re: [PATCH] Allow dwarf2 debug info for function at address 0 Message-ID: <20060724200457.GA15759@nevyn.them.org> Mail-Followup-To: Frederic RISS , gdb-patches@sources.redhat.com, Steven Johnson References: <1153491793.7783.373.camel@crx549.cro.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1153491793.7783.373.camel@crx549.cro.st.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00346.txt.bz2 On Fri, Jul 21, 2006 at 04:23:13PM +0200, Frederic RISS wrote: > The attached patch replaces the HAS_RELOC checks in dwarf2read.c with a > per-objfile lookup for a section loaded at 0. With this modification, > non-relocatable files that have a code at address 0 should be handled > better (no discarded debug information). > As Daniel pointed out in the referenced thread, this solution isn't > perfect because you can have valid code at 0 and at the same time > 'orphaned' debug info that seemingly references the 0 address. However > in the long run tools should correctly handle things like .gnu.linkonce, > and with correct debug info this patch looks like the right thing. (BTW, > was my testing defficient, or do recent GNU toolchains handle linkonce > sections and associated debug info correctly?) It can be pretty hard to trigger this sort of problem. No, GNU handling for linkonce debug info has not really changed in a while. > 2006-07-21 Frederic Riss > > * dwarf2read.c (struct dwarf2_per_objfile): Add has_section_at_zero > field. > (dwarf2_has_info): Initialize dwarf2_per_objfile->has_section_at_zero. > (dwarf2_get_pc_bounds): Use dwarf2_per_objfile->has_section_at_zero > instead of HAS_RELOC test. > (read_partial_die): Ditto. This patch is OK. One possible improvement; there's already a walk over all sections. You could set this flag directly in dwarf2_locate_sections, I think. -- Daniel Jacobowitz CodeSourcery