public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dodji at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/33044] Local static variable in C++ constructor not visible for debugging
Date: Fri, 29 Aug 2008 14:42:00 -0000	[thread overview]
Message-ID: <20080829144106.23886.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33044-14963@http.gcc.gnu.org/bugzilla/>



------- Comment #13 from dodji at gcc dot gnu dot org  2008-08-29 14:41 -------
Created an attachment (id=16162)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16162&action=view)
The debug info of the program

Okay, here is a more accurate analysis. I will refer to the debug info
attached.

As I said in my previous comment, the foofoo variable is decribed by DIE <ec>,
which is a child DIE of the DW_TAG_subprogram DIE at <c5>. <c5> is the DIE of
the constructor A::A(int, int).

In GDB, When I set a beakpoint in A::A(int, int) the debugger actually stops on
a subprogram which DIE is <107>. This <107> DIE describes an "Out-of-Line
Instance" of of A::A(int, int). So <107> rightfully has an
DW_AT_abstract_origin attribute that links back to the abstract tree of
A::A(int, int) at <c5>.

However, foofoo does not have any DIE that is a child node of <107>. The DIE
<14d> seems to be the DIE describing iii, not foofoo.
That might be the reason why GDB is not finding foofoo.

On the other hand, the DWARF3 specs says (in section 3.3.8.2, point 1).

"An entry in the concrete instance tree may be omitted if it contains only a
DW_AT_abstract_origin attribute and either has no children, or its children are
omitted. Such
entries would provide no useful information.".

This text is at PDF page 65 (or document page 53).

So by the DWARF3 spec, I would believe that the debugger should be able to walk
through the DIE of the abstract tree A::A(int, int) to find the entry <ec> that
describes foofoo.

On the other hand, GCC could maybe play nice and generate a DIE for foofoo as a
child node of the lexical block of <107>. But then maybe that would incur some
dwarf bloat.

Any comment ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33044


  parent reply	other threads:[~2008-08-29 14:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 15:11 [Bug debug/33044] New: Local variables " seppo at totalviewtech dot com
2007-08-10 21:08 ` [Bug debug/33044] " pinskia at gcc dot gnu dot org
2007-08-10 21:13 ` pinskia at gcc dot gnu dot org
2007-08-10 21:15 ` pinskia at gcc dot gnu dot org
2007-08-14 20:33 ` seppo at totalviewtech dot com
2007-08-14 22:40 ` pinskia at gcc dot gnu dot org
2007-08-24 13:15 ` nikolay at totalviewtech dot com
2007-08-24 13:52 ` [Bug debug/33044] Local static variable " seppo at totalviewtech dot com
2007-08-24 16:14 ` pinskia at gcc dot gnu dot org
2007-08-24 16:45 ` nikolay at totalviewtech dot com
2007-08-24 16:51   ` Andrew Pinski
2007-08-24 16:51 ` pinskia at gmail dot com
2008-01-13 16:03 ` rguenth at gcc dot gnu dot org
2008-08-27 23:27 ` le dot ben dot smith at gmail dot com
2008-08-29  9:59 ` dodji at gcc dot gnu dot org
2008-08-29 14:42 ` dodji at gcc dot gnu dot org [this message]
2008-08-29 16:10 ` jason at gcc dot gnu dot org

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=20080829144106.23886.qmail@sourceware.org \
    --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).