This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH v2] gdb: dwarf2read: implement handling of variables in Fortran common block


Bernhard & Luis -

	Here is the dump of the analogous parts of the DWARF for my environment for this testcase:


0x00000155:         TAG_common_block [3] *
                     AT_name( "fo_o" )
                     AT_decl_file( "gdb.fortran/common-block.f90" )
                     AT_decl_line( 31 )
                     AT_MIPS_linkage_name( "fo_o_" )
                     AT_location( [0x0000000000000000] )
                     AT_sibling( {0x000001b2} )

0x00000171:             TAG_variable [4]  
                         AT_name( "ix" )
                         AT_decl_file( "gdb.fortran/common-block.f90" )
                         AT_decl_line( 23 )
                         AT_type( {0x00000230} ( integer(kind=4) ) )
                         AT_external( 0x01 )
                         AT_location( [0x0000000000000000] )

0x00000186:             TAG_variable [4]  
                         AT_name( "iy2" )
                         AT_decl_file( "gdb.fortran/common-block.f90" )
                         AT_decl_line( 24 )
                         AT_type( {0x00000243} ( real(kind=4) ) )
                         AT_external( 0x01 )
                         AT_location( [0x0000000000000004] )

On 12 Apr 2016, at 16:00, Heckel, Bernhard <bernhard.heckel@intel.com> wrote:

> On 12/04/2016 02:31, G Helffrich wrote:
>> This patch allows the gdb DWARF reader to handle variables located in Fortran common blocks.  This fixes 20 unexpected failures in the gdb.fortran testsuite with host, target and build triplet x86_64-apple-darwin13.4.0 with gfortran 4.9.2.
>> Re-posted as requested with patch file attached.  Revised from original post to prevent double relocation.
>> 2015-04-12  George Helffrich  <ghfbsd@gmail.com>
>> 
>>         * dwarf2read.c (read_common_block): Relocate symbols in Fortran common
>>           blocks properly, and avoid double relocation.
>>           (read_new_symbol_full): Don't discard zero-offset symbols in Fortran
>>           common blocks.
>>           (_initialize_dwarf2_read): Add debug diagnostic print for common
>>           symbols.
>>         * psymtab.c (print_partial_symbols): Recognize and print
>>           COMMON_BLOCK_DOMAIN.
>>         * symmisc.c (print_symbol):  Recognize and dump LOC_COMMON_BLOCK.
>> 
>> 
> Hi George, Luis,
> 
> I manually patched last week and got 16 fails in the common block testcase.
> Just adding a base-address to the variables lead to failing tests.
> From what I have seen, all the child's of the common block have their own fix (DW_OP_addr) location.
> At least in my environment when I check the DWARF of the compiled testcase.
> 
> Here an excerpt of my DWARF
> <2><4a>: Abbrev Number: 3 (DW_TAG_common_block)
>    <4b>   DW_AT_name        : (indirect string, offset: 0x0): fo_o
>    <4f>   DW_AT_decl_file   : 1
>    <50>   DW_AT_decl_line   : 31
>    <51>   DW_AT_linkage_name: (indirect string, offset: 0x5): fo_o_
>    <55>   DW_AT_location    : 9 byte block: 3 60 10 60 0 0 0 0 0     (DW_OP_addr: 601060)
>    <5f>   DW_AT_sibling     : <0xa1>
> <3><63>: Abbrev Number: 4 (DW_TAG_variable)
>    <64>   DW_AT_name        : ix
>    <67>   DW_AT_decl_file   : 1
>    <68>   DW_AT_decl_line   : 23
>    <69>   DW_AT_type        : <0x116>
>    <6d>   DW_AT_external    : 1
>    <6d>   DW_AT_location    : 9 byte block: 3 60 10 60 0 0 0 0 0     (DW_OP_addr: 601060)
> <3><77>: Abbrev Number: 4 (DW_TAG_variable)
>    <78>   DW_AT_name        : iy2
>    <7c>   DW_AT_decl_file   : 1
>    <7d>   DW_AT_decl_line   : 24
>    <7e>   DW_AT_type        : <0x11d>
>    <82>   DW_AT_external    : 1
>    <82>   DW_AT_location    : 9 byte block: 3 64 10 60 0 0 0 0 0     (DW_OP_addr: 601064)
> 
> May George can sent the important part of the DWARF
> 
> 
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
> 



          G Helffrich
          ghfbsd@gmail.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature


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