Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Frederic RISS <frederic.riss@st.com>
Cc: gdb-patches@sources.redhat.com,
		Steven Johnson <sjohnson@sakuraindustries.com>
Subject: Re: [PATCH] Allow dwarf2 debug info for function at address 0
Date: Mon, 24 Jul 2006 20:05:00 -0000	[thread overview]
Message-ID: <20060724200457.GA15759@nevyn.them.org> (raw)
In-Reply-To: <1153491793.7783.373.camel@crx549.cro.st.com>

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  <frederic.riss@st.com>
> 
> 	* 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


  reply	other threads:[~2006-07-24 20:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21 14:23 Frederic RISS
2006-07-24 20:05 ` Daniel Jacobowitz [this message]
2006-07-24 21:39   ` Frédéric Riss
2006-07-24 22:02     ` Daniel Jacobowitz
2006-07-24 22:30       ` Frédéric Riss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060724200457.GA15759@nevyn.them.org \
    --to=drow@false.org \
    --cc=frederic.riss@st.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=sjohnson@sakuraindustries.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox