From: Daniel Jacobowitz <drow@false.org>
To: Jim Blandy <jimb@redhat.com>
Cc: Joel Brobecker <brobecker@gnat.com>,
Elena Zannoni <ezannoni@redhat.com>,
gdb-patches@sources.redhat.com
Subject: Re: [RFA/dwarf-2] Fix for the null record problem
Date: Wed, 14 Apr 2004 17:47:00 -0000 [thread overview]
Message-ID: <20040414174729.GA612@nevyn.them.org> (raw)
In-Reply-To: <vt21xmq79w7.fsf@zenia.home>
On Wed, Apr 14, 2004 at 12:21:44PM -0500, Jim Blandy wrote:
>
> Joel Brobecker <brobecker@gnat.com> writes:
> > The patch is quite tiny, seems almost obvious, and Elena seemed happy
> > with it. But it didn't get in because she asked that a testcase be added
> > first (on Feb 19):
> > <<
> > the patch looks sensible, but I would like to see the testcase go in
> > at the same time, or we'll forget.
> > >>
> >
> > The new testcase has been checked in now, so I was wondering if somebody
> > had a moment to have a look at it, and confirm Elena's first review?
>
> I think it looks fine; I've just one question before you commit.
>
> As it stands, the code sets TYPE_FLAG_STUB if the type die has no
> children, or if die_is_declaration (die, cu) is true. Your patch
> correctly ditches the first criterion; no problems there.
>
> But it also modifies the second criterion as well, without comment.
> In particular, die_is_declaration checks for both DW_AT_declaration
> and DW_AT_specification, but your patch only tests for
> DW_AT_declaration. I think this is correct: in section 5.6.1, the
> Dwarf 2 spec says that the definition of the type has a
> DW_AT_specification attribute pointing to the declaration. Since it's
> the definition of the type that actually lists the fields,
> DW_AT_specification should not cause GDB to mark the type as a stub.
> Just the opposite: the referent of that attribute is the stub.
>
> The following C++ code produces Dwarf 2 info where the definition of
> struct s::t has a DW_AT_specification attribute, but GDB doesn't skip
> it, and I don't really understand why:
Did you misread die_is_declaration?
return (dwarf2_attr (die, DW_AT_declaration, cu)
&& ! dwarf2_attr (die, DW_AT_specification, cu));
I don't even know what that DW_AT_specification test is doing there -
the idea of a declaration with a specification is pretty peculiar.
But the important bit is that it's not going to report that something
is a declartion, if it has a DW_AT_specification.
If the check is important, then Joel should probably use
!die_is_declaration. This was added by Jason Merrill in 2000, without
much of an explanation; here it is:
http://sources.redhat.com/ml/gdb-patches/2000-q1/msg00015.html
It's not clear why the specification check is there; the important bit
was presumably:
> ! if (die->has_children)
> ! if (die->has_children && ! die_is_declaration (die))
i.e. the point of the patch was to add the DW_AT_declaration check.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-04-14 17:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-19 14:01 Joel Brobecker
2004-02-19 21:52 ` Elena Zannoni
2004-02-19 23:29 ` Andrew Cagney
2004-02-19 23:37 ` Joel Brobecker
2004-02-26 2:31 ` Joel Brobecker
2004-02-26 3:27 ` Daniel Jacobowitz
2004-02-26 19:00 ` Joel Brobecker
2004-04-01 1:18 ` Joel Brobecker
2004-04-13 5:26 ` Joel Brobecker
2004-04-14 17:24 ` Jim Blandy
2004-04-14 17:47 ` Daniel Jacobowitz [this message]
2004-04-15 5:01 ` Jim Blandy
2004-04-15 20:43 ` Joel Brobecker
2004-04-16 3:18 ` Joel Brobecker
2004-04-16 3:59 ` Jim Blandy
2004-04-15 5:33 ` Jim Blandy
2004-02-26 19:49 Michael Elizabeth Chastain
2004-02-26 20:23 ` Joel Brobecker
2004-02-26 21:34 Michael Elizabeth Chastain
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=20040414174729.GA612@nevyn.them.org \
--to=drow@false.org \
--cc=brobecker@gnat.com \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
/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