This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: dwarfout.c - emit DW_AT_LOCATION for global register variables


On Fri, Feb 28, 2003 at 08:56:48AM +0100, Andreas Jaeger wrote:
> Kevin Buettner <kevinb at redhat dot com> writes:
> 
> > I recently learned of a dwarf2 related bug in which insufficient
> > debugging information is being generated for global declarations such
> > as the following:
> >
> >     register void *current asm("$23");
> >
> > As I understand it, this tells gcc to user register 23 for the
> > ``void *'' variable named "current".
> >
> > ``readelf -w'' shows that the following dwarf2 debug info is being
> > generated for this variable:
> >
> >  <1><d13>: Abbrev Number: 3 (DW_TAG_variable)
> >      DW_AT_name        : (indirect string, offset: 0x990): current 
> >      DW_AT_decl_file   : 2 
> >      DW_AT_decl_line   : 4 
> >      DW_AT_type        : <d1e> 
> >
> > When I use the patch appended below, I see the same info as above
> > along with the DW_AT_location attribute needed by a debugger to
> > find the variable:
> >
> >      DW_AT_location    : 1 byte block: 67 	(DW_OP_reg23; )
> > Prior to posting the patch (below) to this list, I asked for opinions
> > regarding this patch from a few folks who are much more knowledgable
> > about gcc than myself.  Jason Merrill responded that it looks good.
> 
> Please follow the GCC patch submission guidelines that mean that you
> should bootstrap and regression test your patch on at least one
> platform and state in your email where you've done so.  If you've done
> the tests, just tell us - and if not, please do and tell us
> afterwards;-).
> 
> Isn't this something that should go also into GCC 3.3?  Or is it only
> relevant for GCC mainline?

At least GCC 3.2 and 3.3 are also affected.  Not sure how far back it
goes.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]