This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [3/3] RFC - optional patch to restore DW_AT_data_member_location
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 21 Aug 2012 15:12:08 -0700
- Subject: Re: [3/3] RFC - optional patch to restore DW_AT_data_member_location
- References: <87628cfbg2.fsf@fleche.redhat.com>
On Tue, Aug 21, 2012 at 9:37 AM, Tom Tromey <tromey@redhat.com> wrote:
> This patch reimplements DW_AT_data_member_location for variables
> appearing in a Fortran common block.
>
> This attribute is not specified by DWARF. It is apparently an old
> approach used by gfortran prior to 2008; at least it appeared in
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23057
>
> This patch is based on the idea that such attributes are relatively
> rare. So, rather than implement complicated support for them, gdb just
> rewrites them into an ordinary location expression that uses the common
> block's location as a subroutine.
>
> I've included a new test case, which I made by editing the assembly
> output of gfortran by hand.
>
> Built and regtested on x86-64 Fedora 16.
>
> I consider this patch optional, because I think it is too much
> complicated code in support of a marginal and obsolete feature.
> However, I wrote it in case someone thinks that supporting 4 year old
> versions of gfortran is important.
>
> Tom
>
> * dwarf2read.c (mark_common_block_symbol_computed): New function.
> (read_common_block): Handle child DIEs with
> DW_AT_data_member_location.
> (new_symbol_full): Add special case for common blocks.
>
> * gdb.dwarf2/dw2-common-block.S: New file.
> * gdb.dwarf2/dw2-common-block.exp: New file.
I'm all for holding off until someone presents a *compelling* use case.