This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: dwarfout.c - emit DW_AT_LOCATION for global register variables
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: Kevin Buettner <kevinb at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Feb 2003 10:03:49 -0500
- Subject: Re: RFA: dwarfout.c - emit DW_AT_LOCATION for global register variables
- References: <1030228060221.ZM27945@localhost.localdomain> <hoadgg7s8v.fsf@byrd.suse.de>
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