This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCHES, PING*5] Enhance standard DWARF for Ada
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Cc: Cary Coutant <ccoutant at gmail dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Mon, 21 Dec 2015 15:15:57 +0100
- Subject: Re: [PATCHES, PING*5] Enhance standard DWARF for Ada
- Authentication-results: sourceware.org; auth=none
- References: <55A76C7B dot 7080303 at adacore dot com> <55B0C74D dot 3040907 at adacore dot com> <55BB53F3 dot 1080101 at adacore dot com> <55BB56B1 dot 8080407 at adacore dot com> <55C5C54E dot 8050700 at adacore dot com> <55E4025B dot 3050309 at adacore dot com> <5626A05D dot 3090905 at adacore dot com> <564CE0F7 dot 4060801 at redhat dot com> <56531A3E dot 40504 at adacore dot com> <56538037 dot 7060900 at redhat dot com> <56542B0F dot 6040102 at adacore dot com> <5655FF72 dot 7030901 at redhat dot com> <5656FC6C dot 7040008 at adacore dot com> <566B3151 dot 4000209 at redhat dot com> <56712691 dot 4050709 at adacore dot com> <5671D7E6 dot 6070508 at redhat dot com> <5672C269 dot 1060405 at adacore dot com> <567448B7 dot 7040408 at redhat dot com> <56746B35 dot 4060503 at adacore dot com>
On 12/18/2015 09:23 PM, Pierre-Marie de Rodat wrote:
On 12/18/2015 06:56 PM, Jason Merrill wrote:
These broke a lot of tests in the GDB C++ testsuite. Specifically, the
commit
DWARF: handle variable-length records and variant parts
Arg, sad to hear that! I did testing at some point with the GDB
testsuiteâ Iâll investigate on Monday, thank you for the heads up.
All the regressions I could reproduce have a single cause: an oversight
in protective code. That patch tries to disable dynamic data member
offset generation by default because GDB does not handle it very well
right now. But it should not disable this for DW_TAG_inheritance, in
which dynamic data member offset *is* supported by GDB.
The attached patch fixes this oversight. Bootstrapped and regtested on
x86_64-linux; I also made sure it fixed the GDB regressions on the same
platform (for Ada, C, C++ and Fortran). Ok to commit?
--
Pierre-Marie de Rodat
>From bd4bd565391a54f40c9f882c2df91ec48e841c99 Mon Sep 17 00:00:00 2001
From: Pierre-Marie de Rodat <derodat@adacore.com>
Date: Mon, 21 Dec 2015 15:04:59 +0100
Subject: [PATCH] DWARF: allow dynamic data member offsets for inheritance info
An unintended effect of the recently introduced machinery to handle
dynamic data member offsets in variable-length records (when
-fgnat-encodings=minimal) prevented GCC from describing correctly
inheritance information for classes in C++, which is a regression.
This change rectifies this machinery in this case.
gcc/ChangeLog:
* dwarf2out.c (add_data_member_location_attribute): Do not
disable dynamic data member offsets descriptions for TREE_BINFO
members.
---
gcc/dwarf2out.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 320a077..0a5cc54 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -16727,21 +16727,21 @@ add_data_member_location_attribute (dw_die_ref die,
{
loc_descr = field_byte_offset (decl, ctx, &offset);
- /* Data member location evalutation start with the base address on the
+ /* If loc_descr is available then we know the field offset is dynamic.
+ However, GDB does not handle dynamic field offsets very well at the
+ moment. */
+ if (loc_descr != NULL && gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL)
+ {
+ loc_descr = NULL;
+ offset = 0;
+ }
+
+ /* Data member location evalutation starts with the base address on the
stack. Compute the field offset and add it to this base address. */
- if (loc_descr != NULL)
+ else if (loc_descr != NULL)
add_loc_descr (&loc_descr, new_loc_descr (DW_OP_plus, 0, 0));
}
- /* If loc_descr is available then we know the field offset is dynamic.
- However, GDB does not handle dynamic field offsets very well at the
- moment. */
- if (loc_descr != NULL && gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL)
- {
- loc_descr = NULL;
- offset = 0;
- }
-
if (! loc_descr)
{
if (dwarf_version > 2)
--
2.3.3.199.g52cae64