This is the mail archive of the gdb-prs@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]

[Bug gdb/11932] New: DT_AT_variable_parameter usage breaks Fortran parameters


With gdb-7.1.90.20100820, and using the gdb.fortran/array-element test program,
parameters are broken in subroutine 'sub' when using the Intel Fortran Compiler
(ifort).  It still works ok for gfortran.

In the test code..
        subroutine sub(a,n)

integer n gets the following DWARF
 <2><137>: Abbrev Number: 8 (DW_TAG_formal_parameter)
    <138>   DW_AT_decl_line   : 26      
    <139>   DW_AT_decl_column : 26      
    <13a>   DW_AT_decl_file   : 1       
    <13b>   DW_AT_type        : <0x162> 
    <13f>   DW_AT_variable_parameter: 1 
    <140>   DW_AT_name        : n       
    <142>   DW_AT_location    : 3 byte block: 76 48 6   (DW_OP_breg6: -56;
DW_OP_deref)

and type:

 <1><162>: Abbrev Number: 2 (DW_TAG_base_type)
    <163>   DW_AT_byte_size   : 4       
    <164>   DW_AT_encoding    : 5       (signed)
    <165>   DW_AT_name        : INTEGER(4)      

- note the type of 'n' is an integer, not a reference, the DW_AT_location points
to the integer.

Upshot is in sub, for the 7.2 series pre-release branch:

(gdb) p n
$1 = (REF TO -> ( INTEGER(4) )) @0x1051a0000000a: <error reading variable>

gdb 7.1 would have reported:

(gdb) p n
$1 = 10


The commit which causes this is (sorry Pierre!):

2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>

        * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter
        attribute.

which was added for supporting a Pascal compiler.   Remove the commit and it
works again.

-- 
           Summary: DT_AT_variable_parameter usage breaks Fortran parameters
           Product: gdb
           Version: 7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: david at lecomber dot net
                CC: gdb-prs at sourceware dot org,muller at ics dot u-
                    strasbg dot fr


http://sourceware.org/bugzilla/show_bug.cgi?id=11932

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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