public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jan.kratochvil at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/60476] New: DWARF DW_AT_declaration && DW_AT_low_pc
Date: Sun, 09 Mar 2014 18:08:00 -0000	[thread overview]
Message-ID: <bug-60476-4@http.gcc.gnu.org/bugzilla/> (raw)

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.)


                 reply	other threads:[~2014-03-09 18:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60476-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).