From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] New dwarf2_attribute_true_p function in dwarf2read.c
Date: Fri, 16 Apr 2004 14:20:00 -0000 [thread overview]
Message-ID: <20040416142022.GC9718@nevyn.them.org> (raw)
In-Reply-To: <20040415202318.GD1564@gnat.com>
On Thu, Apr 15, 2004 at 01:23:18PM -0700, Joel Brobecker wrote:
> Hello,
>
> Following a suggestion made by JimB in:
>
> http://sources.redhat.com/ml/gdb-patches/2004-04/msg00297.html
>
> I made the following change:
>
> 2004-04-15 Joel Brobecker <brobecker@gnat.com>
>
> * dwarf2read.c (dwarf2_attribute_true_p): New function.
> (die_is_declaration): Use the function above.
>
> Tested on x86-linux, no regression.
>
> OK to apply?
Sorry, this patch is incorrect.
> - return (dwarf2_attr (die, DW_AT_declaration, cu)
> - && ! dwarf2_attr (die, DW_AT_specification, cu));
> + /* A DIE is a declaration if it has a DW_AT_declaration attribute
> + which value is non-zero. However, we have to be careful of DIEs
> + with a DW_AT_specification attribute, because dwarf2_attribute_p()
> + follows this attribute, and therefore might cause us to find a
> + DW_AT_declaration attribute, but that belongs to a different DIE. */
> + return (dwarf2_attribute_true_p (die, DW_AT_declaration, cu)
> + && ! dwarf2_attribute_true_p (die, DW_AT_specification, cu));
> }
>
> /* Return the die giving the specification for DIE, if there is
First of all, there's no dwarf2_attribute_p, you mean dwarf2_attr and
dwarf2_attr_true_p.
Secondly, the predicate function should be used for flag attributes
like DW_AT_declaration, but checking DW_UNSND for DW_AT_specification
is incorrect - it's a DIE reference. dwarf2_attr != NULL is the right
check. Some day I hope to add checking macros to verify we're using
the right member of each union...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-04-16 14:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-15 20:23 Joel Brobecker
2004-04-16 4:15 ` Jim Blandy
2004-04-16 4:32 ` Joel Brobecker
2004-04-16 14:20 ` Daniel Jacobowitz [this message]
2004-04-16 16:18 ` Joel Brobecker
2004-04-16 21:37 ` Jim Blandy
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=20040416142022.GC9718@nevyn.them.org \
--to=drow@false.org \
--cc=brobecker@gnat.com \
--cc=gdb-patches@sources.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