This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/60476] New: DWARF DW_AT_declaration && DW_AT_low_pc
- From: "jan.kratochvil at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 09 Mar 2014 18:07:58 +0000
- Subject: [Bug debug/60476] New: DWARF DW_AT_declaration && DW_AT_low_pc
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60476
Bug ID: 60476
Summary: DWARF DW_AT_declaration && DW_AT_low_pc
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: jan.kratochvil at redhat dot com
Host: x86_64-unknown-linux-gnu
Target: x86_64-redhat-linux-gnu
Created attachment 32318
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32318&action=edit
GDB test patch to catch such DWARF.
GCC Ada DWARF IMO violates DWARF-4:
3.3.3 Subroutine and Entry Point Locations
A subroutine entry representing a subroutine declaration that is not also a
definition does not have code address or range attributes.
<2><46935>: Abbrev Number: 116 (DW_TAG_subprogram)
<46936> DW_AT_abstract_origin: <0x45e96>
<4693a> DW_AT_declaration : 1
<2><45e96>: Abbrev Number: 113 (DW_TAG_subprogram)
<45e97> DW_AT_name : atree__copy_separate_tree__copy_list
<45e9b> DW_AT_decl_file : 2
<45e9c> DW_AT_decl_line : 805
<45e9e> DW_AT_type : <0x355a6>
<45ea2> DW_AT_low_pc : 0x44ebf0
<45eaa> DW_AT_high_pc : 0x2a2
<45eb2> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<45eb4> DW_AT_GNU_all_call_sites: 1
The first DIE <46935> is used only by:
<4><46be8>: Abbrev Number: 103 (DW_TAG_GNU_call_site)
<46be9> DW_AT_low_pc : 0x44f579
<46bf1> DW_AT_abstract_origin: <0x46935>
<46bf5> DW_AT_sibling : <0x46c00>
I have not seen this kind of DIE in non-Ada builds but I cannot prove it.
If not anything else it is a redundant DIE, DW_TAG_GNU_call_site could point to
<45e96> directly.
Steps to Reproduce:
../gcc48/configure --enable-languages=ada --enable-bootstrap
make profiledbootstrap
../fresh-new-gdb/gdb/gdb -readnow gcc/gnatbind
(Formerly filed as in fact unrelated PR debug/60339.)