Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Elias Athanasopoulos <eathan@otenet.gr>
To: Richard Henderson <rth@redhat.com>
Cc: Pierre Habraken <Pierre.Habraken@imag.fr>,
	binutils@sources.redhat.com, gdb@sources.redhat.com,
	Richard.Earnshaw@arm.com
Subject: Re: [PATCH] Re: Section .debug_info in object file
Date: Sun, 15 Sep 2002 02:25:00 -0000	[thread overview]
Message-ID: <20020915124258.A1134@neutrino.particles.org> (raw)
In-Reply-To: <20020912205434.GA20375@redhat.com>; from rth@redhat.com on Thu, Sep 12, 2002 at 01:54:34PM -0700

Hi Richard,

On Thu, Sep 12, 2002 at 01:54:34PM -0700, Richard Henderson wrote:
> On Thu, Sep 12, 2002 at 10:03:03PM +0300, Elias Athanasopoulos wrote:
> > 	* dwarf2dbg.c (out_debug_abbrev): Add support for the DW_AT_name field.
> > 	(out_debug_info): Likewise.
> 
> I suppose we could do something like this.
> 
> But it seems to me that this is a gdb bug.  The complete file+line
> mapping is available in .debug_line.  What purpose does the AT_name
> field of the compilation unit serve?

After some short investigation I concluded that gdb stores in the
symtable along with the file name (which is taken from DW_AT_name) the
lowpc field (DW_AT_low_pc). This happens inside dwarf2_build_psymtabs_hard():

      /* Allocate a new partial symbol table structure */
      pst = start_psymtab_common (objfile, objfile->section_offsets,
                                  comp_unit_die.name ? comp_unit_die.name : "",
				  comp_unit_die.lowpc,
				  objfile->global_psymbols.next,
	                          objfile->static_psymbols.next);

I guess this information can be taken also from .debug_line. Do we want
to build the symtable using .debug_line instead of .debug_info?

Also, about my previous patch, gcc includes the DW_AT_name field in 
.debug_abbrev, but gas does not. So, readelf expects to find a DW_AT_name
field in .debug_info section, which is created by gas. I believe that gas
should export the DW_AT_name in the .debug_info section, otherwise utilities
such as readelf will have problems parsing the debug information correctly.

Elias

-- 
http://gnewtellium.sourceforge.net			MP3 is not a crime.	


  parent reply	other threads:[~2002-09-15  9:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12  2:42 Pierre Habraken
2002-09-12  4:46 ` Keith.Walker
2002-09-14  4:49   ` Pierre Habraken
2002-09-16  3:10     ` Keith.Walker
2002-09-16  3:30       ` Elias Athanasopoulos
2002-09-16  3:43       ` Pierre Habraken
2002-09-12 11:45 ` [PATCH] " Elias Athanasopoulos
2002-09-12 13:54   ` Richard Henderson
2002-09-12 14:55     ` Elias Athanasopoulos
2002-09-15  2:25     ` Elias Athanasopoulos [this message]
2002-09-16 19:35       ` Richard Henderson
2002-09-16 19:51   ` Richard Henderson

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=20020915124258.A1134@neutrino.particles.org \
    --to=eathan@otenet.gr \
    --cc=Pierre.Habraken@imag.fr \
    --cc=Richard.Earnshaw@arm.com \
    --cc=binutils@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=rth@redhat.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