From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100984 invoked by alias); 21 Dec 2015 14:16:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 100971 invoked by uid 89); 21 Dec 2015 14:16:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=protective, that!, H*r:10.10.1, dwarf2out.c X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 21 Dec 2015 14:16:00 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 924AB2EE0028; Mon, 21 Dec 2015 15:15:57 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JITmeWCIaMd; Mon, 21 Dec 2015 15:15:57 +0100 (CET) Received: from [10.10.1.112] (cacatoes.act-europe.fr [10.10.1.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 6EB402EE0002; Mon, 21 Dec 2015 15:15:57 +0100 (CET) Subject: Re: [PATCHES, PING*5] Enhance standard DWARF for Ada To: Jason Merrill , gcc-patches@gcc.gnu.org References: <55A76C7B.7080303@adacore.com> <55B0C74D.3040907@adacore.com> <55BB53F3.1080101@adacore.com> <55BB56B1.8080407@adacore.com> <55C5C54E.8050700@adacore.com> <55E4025B.3050309@adacore.com> <5626A05D.3090905@adacore.com> <564CE0F7.4060801@redhat.com> <56531A3E.40504@adacore.com> <56538037.7060900@redhat.com> <56542B0F.6040102@adacore.com> <5655FF72.7030901@redhat.com> <5656FC6C.7040008@adacore.com> <566B3151.4000209@redhat.com> <56712691.4050709@adacore.com> <5671D7E6.6070508@redhat.com> <5672C269.1060405@adacore.com> <567448B7.7040408@redhat.com> <56746B35.4060503@adacore.com> Cc: Cary Coutant , Eric Botcazou From: Pierre-Marie de Rodat Message-ID: <5678099D.9030305@adacore.com> Date: Mon, 21 Dec 2015 14:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56746B35.4060503@adacore.com> Content-Type: multipart/mixed; boundary="------------040108080807060604030808" X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01982.txt.bz2 This is a multi-part message in MIME format. --------------040108080807060604030808 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-length: 960 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 --------------040108080807060604030808 Content-Type: text/x-diff; name="0001-DWARF-allow-dynamic-data-member-offsets-for-inherita.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-DWARF-allow-dynamic-data-member-offsets-for-inherita.pa"; filename*1="tch" Content-length: 2117 >From bd4bd565391a54f40c9f882c2df91ec48e841c99 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat 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 --------------040108080807060604030808--