Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix PR gdb/11702, printing of static const member variables
Date: Mon, 28 Jun 2010 18:26:00 -0000	[thread overview]
Message-ID: <AANLkTilD8Pzc_3o8DebVkYZclyIIKOlApvEHz6zVkDAi@mail.gmail.com> (raw)
In-Reply-To: <20100628110222.GA21051@host0.dyn.jankratochvil.net>

On Mon, Jun 28, 2010 at 4:02 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Sun, 27 Jun 2010 20:24:42 +0200, Doug Evans wrote:
>> btw, the dwarf4 standard, as I read it, says static member variables are
>> identified by having DW_AT_external.  [4.1 Data Object Entries]
>> However, dwarf2_add_field is calling die_is_declaration.
>
> echo 'class C { static const float i = 1; } c;'|g++ -c -o 1.o -Wall -g -x c++ -
>    < c>   DW_AT_producer    : (indirect string, offset: 0x11): GNU C++ 4.6.0 20100628 (experimental)
>  <2><33>: Abbrev Number: 3 (DW_TAG_member)
>    <34>   DW_AT_name        : i
>    <38>   DW_AT_type        : <0x45>
>    <3c>   DW_AT_external    : 1
>    <3d>   DW_AT_accessibility: 3       (private)
>    <3e>   DW_AT_declaration : 1
>    <3f>   DW_AT_const_value : 4 byte block: 0 0 80 3f
>
> Isn't it primarily a bug in GCC?  There is no other DIE for `i' and it is
> a complete definition so there is no place for DW_AT_declaration there.
>
> Just such GCC change will be incompatible with existing GDBs, maybe to make
> the GCC change only for -gdwarf-4 upwards which is incompatible with older
> GDBs anyway?

I'm not sure I follow.
If all the GCC versions we care about are also adding DW_AT_external
to the DIE, gdb *could* check for it instead of die_is_declaration,
right?  Or am I missing something?

> 4.4.5 20100627 uses DW_TAG_variable but 4.5.1 20100627 uses DW_TAG_member.

Ah.

> Otherwise - for the second patch - there are some needless whitespace changes.
> Also I would test also `float' const field there using LOC_CONST_BYTES; it
> works but just to test it, based on your IRC comments about LOC_CONST_BYTES.

I'll add a few more testcases.  Thanks.
[And I'll check the whitespace fix in separately.]


  reply	other threads:[~2010-06-28 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-27 18:25 Doug Evans
2010-06-27 18:35 ` Doug Evans
2010-06-27 18:40   ` Doug Evans
2010-06-27 23:07     ` Doug Evans
2010-06-28 17:06     ` Tom Tromey
2010-06-28 11:02 ` Jan Kratochvil
2010-06-28 18:26   ` Doug Evans [this message]
2010-06-28 19:10     ` Jan Kratochvil
2010-06-29  9:12       ` Jan Kratochvil
2010-06-29 17:07   ` Doug Evans

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=AANLkTilD8Pzc_3o8DebVkYZclyIIKOlApvEHz6zVkDAi@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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