This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/38479] Incorrect dwarf generated for function with parameters greater 4 words in length
- From: "je at rowley dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Dec 2008 12:13:25 -0000
- Subject: [Bug debug/38479] Incorrect dwarf generated for function with parameters greater 4 words in length
- References: <bug-38479-17063@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from je at rowley dot co dot uk 2008-12-24 12:13 -------
The problem still appears to exist in on the trunk.
The generated code and the location of parameters on the stack are different
however the debug information describing the location of the parameters
is still out by 4. Arguments p1, p2, p3 and p4 are stored at fp-4, fp-8, fp-12
and fp+4 respectively. The debug information states that they are located at
fp+8-8, fp+8-12, fp+8-16 and fp+8-0.
GCC Build Details:
Using built-in specs.
Target: arm-unknown-elf
Configured with: /home/products/build/gcc/gnu-trunk/sources/gcc-trunk/configure
--build i686-pc-linux-gnu --host i686-pc-linux-gnu --target arm-unknown-elf
--prefix=/home/products/build/gcc/gnu-trunk/i686-pc-linux-gnu/install
--enable-languages=c++,c
--with-gmp=/home/products/build/gcc/gnu-trunk/i686-pc-linux-gnu/install
--with-mpfr=/home/products/build/gcc/gnu-trunk/i686-pc-linux-gnu/install
--with-included-gettext
Thread model: single
gcc version 4.4.0 20081224 (experimental) (GCC)
foo.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <foo>:
0: e24dd004 sub sp, sp, #4 ; 0x4
4: e52db004 push {fp} ; (str fp, [sp, #-4]!)
8: e28db000 add fp, sp, #0 ; 0x0
c: e24dd00c sub sp, sp, #12 ; 0xc
10: e50b0004 str r0, [fp, #-4]
14: e50b1008 str r1, [fp, #-8]
18: e50b200c str r2, [fp, #-12]
1c: e58b3004 str r3, [fp, #4]
20: e3a03000 mov r3, #0 ; 0x0
24: e1a00003 mov r0, r3
28: e28bd000 add sp, fp, #0 ; 0x0
2c: e8bd0800 pop {fp}
30: e28dd004 add sp, sp, #4 ; 0x4
34: e12fff1e bx lr
Contents of the .debug_abbrev section:
Number TAG
1 DW_TAG_compile_unit [has children]
DW_AT_producer DW_FORM_strp
DW_AT_language DW_FORM_data1
DW_AT_name DW_FORM_strp
DW_AT_comp_dir DW_FORM_strp
DW_AT_low_pc DW_FORM_addr
DW_AT_high_pc DW_FORM_addr
DW_AT_stmt_list DW_FORM_data4
2 DW_TAG_subprogram [has children]
DW_AT_external DW_FORM_flag
DW_AT_name DW_FORM_string
DW_AT_decl_file DW_FORM_data1
DW_AT_decl_line DW_FORM_data1
DW_AT_prototyped DW_FORM_flag
DW_AT_type DW_FORM_ref4
DW_AT_low_pc DW_FORM_addr
DW_AT_high_pc DW_FORM_addr
DW_AT_frame_base DW_FORM_data4
DW_AT_sibling DW_FORM_ref4
3 DW_TAG_formal_parameter [no children]
DW_AT_name DW_FORM_string
DW_AT_decl_file DW_FORM_data1
DW_AT_decl_line DW_FORM_data1
DW_AT_type DW_FORM_ref4
DW_AT_location DW_FORM_block1
4 DW_TAG_base_type [no children]
DW_AT_byte_size DW_FORM_data1
DW_AT_encoding DW_FORM_data1
DW_AT_name DW_FORM_string
5 DW_TAG_base_type [no children]
DW_AT_byte_size DW_FORM_data1
DW_AT_encoding DW_FORM_data1
DW_AT_name DW_FORM_strp
The section .debug_info contains:
Compilation Unit @ offset 0x0:
Length: 0x82 (32-bit)
Version: 2
Abbrev Offset: 0
Pointer Size: 4
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
< c> DW_AT_producer : (indirect string, offset: 0x4f): GNU C 4.4.0
20081224 (experimental)
<10> DW_AT_language : 1 (ANSI C)
<11> DW_AT_name : (indirect string, offset: 0x73): foo.c
<15> DW_AT_comp_dir : (indirect string, offset: 0xe):
/home/products/build/gcc/gnu-trunk/i686-pc-linux-gnu/install/bin
<19> DW_AT_low_pc : 0x0
<1d> DW_AT_high_pc : 0x38
<21> DW_AT_stmt_list : 0x0
<1><25>: Abbrev Number: 2 (DW_TAG_subprogram)
<26> DW_AT_external : 1
<27> DW_AT_name : foo
<2b> DW_AT_decl_file : 1
<2c> DW_AT_decl_line : 1
<2d> DW_AT_prototyped : 1
<2e> DW_AT_type : <0x77>
<32> DW_AT_low_pc : 0x0
<36> DW_AT_high_pc : 0x38
<3a> DW_AT_frame_base : 0x0 (location list)
<3e> DW_AT_sibling : <0x77>
<2><42>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<43> DW_AT_name : p1
<46> DW_AT_decl_file : 1
<47> DW_AT_decl_line : 1
<48> DW_AT_type : <0x77>
<4c> DW_AT_location : 2 byte block: 91 78 (DW_OP_fbreg: -8)
<2><4f>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<50> DW_AT_name : p2
<53> DW_AT_decl_file : 1
<54> DW_AT_decl_line : 1
<55> DW_AT_type : <0x77>
<59> DW_AT_location : 2 byte block: 91 74 (DW_OP_fbreg: -12)
<2><5c>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<5d> DW_AT_name : p3
<60> DW_AT_decl_file : 1
<61> DW_AT_decl_line : 1
<62> DW_AT_type : <0x77>
<66> DW_AT_location : 2 byte block: 91 70 (DW_OP_fbreg: -16)
<2><69>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<6a> DW_AT_name : p4
<6d> DW_AT_decl_file : 1
<6e> DW_AT_decl_line : 1
<6f> DW_AT_type : <0x7e>
<73> DW_AT_location : 2 byte block: 91 0 (DW_OP_fbreg: 0)
<1><77>: Abbrev Number: 4 (DW_TAG_base_type)
<78> DW_AT_byte_size : 4
<79> DW_AT_encoding : 5 (signed)
<7a> DW_AT_name : int
<1><7e>: Abbrev Number: 5 (DW_TAG_base_type)
<7f> DW_AT_byte_size : 8
<80> DW_AT_encoding : 5 (signed)
<81> DW_AT_name : (indirect string, offset: 0x0): long long int
The section .debug_frame contains:
00000000 0000000c ffffffff CIE
Version: 1
Augmentation: ""
Code alignment factor: 1
Data alignment factor: -4
Return address column: 14
DW_CFA_def_cfa: r13 ofs 0
00000010 00000018 00000000 FDE cie=00000000 pc=00000000..00000038
DW_CFA_advance_loc: 4 to 00000004
DW_CFA_def_cfa_offset: 4
DW_CFA_advance_loc: 4 to 00000008
DW_CFA_def_cfa_offset: 8
DW_CFA_offset_extended_sf: r11 at cfa-8
DW_CFA_advance_loc: 4 to 0000000c
DW_CFA_def_cfa_register: r11
Contents of the .debug_loc section:
Offset Begin End Expression
00000000 00000000 00000004 (DW_OP_reg13)
00000000 00000004 00000008 (DW_OP_breg13: 4)
00000000 00000008 0000000c (DW_OP_breg13: 8)
00000000 0000000c 00000038 (DW_OP_breg11: 8)
00000000 <End of list>
Contents of the .debug_pubnames section:
Length: 22
Version: 2
Offset into .debug_info section: 0x0
Size of area in .debug_info section: 134
Offset Name
37 foo
The section .debug_aranges contains:
Length: 28
Version: 2
Offset into .debug_info: 0x0
Pointer Size: 4
Segment Size: 0
Address Length
00000000 00000038
00000000 00000000
Contents of the .debug_str section:
0x00000000 6c6f6e67 206c6f6e 6720696e 74002f68 long long int./h
0x00000010 6f6d652f 70726f64 75637473 2f627569 ome/products/bui
0x00000020 6c642f67 63632f67 6e752d74 72756e6b ld/gcc/gnu-trunk
0x00000030 2f693638 362d7063 2d6c696e 75782d67 /i686-pc-linux-g
0x00000040 6e752f69 6e737461 6c6c2f62 696e0047 nu/install/bin.G
0x00000050 4e552043 20342e34 2e302032 30303831 NU C 4.4.0 20081
0x00000060 32323420 28657870 6572696d 656e7461 224 (experimenta
0x00000070 6c290066 6f6f2e63 00 l).foo.c.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38479