15860 – [3.3/3.4/4.0 regression] No DW_AT_location debug info is emitted for formal arguments to a function that uses "register" qualifiers (original) (raw)

Description Randolph Chung 2004-06-07 18:25:14 UTC

Compile the attached code with "gcc -g -c structs2.c" [structs2.c comes from the gdb testsuite]

The arguments to param_reg() are not described in the dwarf debug info. e.g.: $ readelf -wi structs2.o [...] <2><69>: Abbrev Number: 6 (DW_TAG_formal_parameter) DW_AT_name : (indirect string, offset: 0x27): pr_char DW_AT_decl_file : 1 DW_AT_decl_line : 28 DW_AT_type : <96>

No DW_AT_location information is given.

With gcc-3.0, I see: <2><82>: Abbrev Number: 6 (DW_TAG_formal_parameter) DW_AT_name : pr_char DW_AT_decl_file : 1 DW_AT_decl_line : 28 DW_AT_type : DW_AT_location : 2 byte block: 91 b (DW_OP_fbreg: 11)

param_reg() is defined as: static void param_reg (register signed char pr_char, register unsigned char pr_uchar, register short pr_short, register unsigned short pr_ushort);

if the "register" qualifier is removed, the correct debug information is emitted.

Dan Jacobowitz tells me that on i386/mips, with gcc-3.3, he does not see this problem. On hppa-linux i see this with gcc-3.3/3.4/3.5

This was also observed by Corinna Vinschen (sh target): http://sources.redhat.com/ml/gdb/2004-03/msg00043.html

Comment 2 Drea Pinski 2004-06-07 18:52:27 UTC

hmm, I see it fine on powerpc-apple-darwin on the mainline just fine. I wonder if this is a target problem some how.

Comment 3 Mark Mitchell 2004-08-29 18:53:26 UTC

Postponed until GCC 3.4.3.

Comment 4 Richard Henderson 2004-10-13 18:54:43 UTC

It would seem that this would affect any big-endian target for which the ABI forces type promotion of parameters.

Comment 6 Richard Henderson 2004-10-13 18:57:13 UTC

Someone will need to test this on an affected target, both with gcc and the gdb testsuite.

Comment 7 Randolph Chung 2004-10-13 21:24:27 UTC

Verified with gcc-3.4.1 and gdb-6.2.1 on hppa-linux. Thanks Richard.

Comment 10 Richard Henderson 2004-10-13 23:45:51 UTC

Fixed.

Comment 11 Giovanni Bajo 2004-10-14 01:45:17 UTC

What about 3.3?