From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: revert: Re: [patch] Fix DWARF-3+ DW_AT_accessibility default assumption
Date: Wed, 09 Mar 2011 11:46:00 -0000 [thread overview]
Message-ID: <20110309071209.GA6661@host1.jankratochvil.net> (raw)
In-Reply-To: <20110308175550.GA4384@host1.jankratochvil.net>
On Tue, 08 Mar 2011 18:55:50 +0100, Jan Kratochvil wrote:
> Checked in. Dealing with testsuite results on FSF GDB was difficult.
> http://sourceware.org/ml/gdb-cvs/2011-03/msg00115.html
Reverted. It broke compatibility with `gcc-4.5 -gdwarf-3'.
gcc-4.5 violates DWARF:
<1><2d>: Abbrev Number: 2 (DW_TAG_class_type)
<2e> DW_AT_name : C
<30> DW_AT_byte_size : 4
<2><37>: Abbrev Number: 3 (DW_TAG_member)
<38> DW_AT_name : (indirect string, offset: 0x0): public_
<3e> DW_AT_type : <0x44>
<42> DW_AT_data_member_location: 0
DWARF-4 specifies:
An inheritance entry may have a DW_AT_accessibility attribute. If no
accessibility attribute is present, private access is assumed for an entry of a
class and public access is assumed for an entry of an interface, struct or
union.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45124
There will probably need to be a DW_AT_producer check.
Sorry,
Jan
http://sourceware.org/ml/gdb-cvs/2011-03/msg00128.html
--- src/gdb/ChangeLog 2011/03/09 06:24:05 1.12775
+++ src/gdb/ChangeLog 2011/03/09 07:07:53 1.12776
@@ -1,3 +1,11 @@
+2011-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Revert:
+ 2011-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Fix DWARF-3+ DW_AT_accessibility default assumption.
+ * dwarf2read.c (dwarf2_add_field): Fix new_field->accessibility for
+ cu->header.version >= 3.
+
2011-03-09 Yao Qi <yao@codesourcery.com>
* common/Makefile.in: Remove.
--- src/gdb/dwarf2read.c 2011/03/08 17:54:44 1.507
+++ src/gdb/dwarf2read.c 2011/03/09 07:07:55 1.508
@@ -6238,25 +6238,13 @@
}
fip->nfields++;
- if (cu->header.version < 3)
- {
- /* The default DWARF 2 accessibility for members is public, the default
- accessibility for inheritance is private. */
-
- if (die->tag != DW_TAG_inheritance)
- new_field->accessibility = DW_ACCESS_public;
- else
- new_field->accessibility = DW_ACCESS_private;
- }
+ /* Handle accessibility and virtuality of field.
+ The default accessibility for members is public, the default
+ accessibility for inheritance is private. */
+ if (die->tag != DW_TAG_inheritance)
+ new_field->accessibility = DW_ACCESS_public;
else
- {
- /* DWARF 3 specifies the default accessibility explicitly. */
-
- if (die->parent->tag == DW_TAG_class_type)
- new_field->accessibility = DW_ACCESS_private;
- else
- new_field->accessibility = DW_ACCESS_public;
- }
+ new_field->accessibility = DW_ACCESS_private;
new_field->virtuality = DW_VIRTUALITY_none;
attr = dwarf2_attr (die, DW_AT_accessibility, cu);
next prev parent reply other threads:[~2011-03-09 7:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 19:38 Jan Kratochvil
2011-01-26 1:58 ` Jan Kratochvil
2011-03-08 18:03 ` Jan Kratochvil
2011-03-09 11:46 ` Jan Kratochvil [this message]
2011-03-21 15:55 ` reposted: Re: revert: " Jan Kratochvil
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=20110309071209.GA6661@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.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