From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61070 invoked by alias); 2 Nov 2016 15:31:59 -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 61060 invoked by uid 89); 2 Nov 2016 15:31:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=team X-HELO: mail-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Nov 2016 15:31:48 +0000 Received: by mail-oi0-f52.google.com with SMTP id 128so21224621oih.0 for ; Wed, 02 Nov 2016 08:31:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZWEAecYr+aY1MUGKENmFP5ryJgLmhQNFSt3aMJqjZs8=; b=LhAWJDl9uz45WI1nr8VchXQMXRIeAUAfxlkjwqRH/rN+Q80WAJk1XMZY5tjjmW8zRR X97KSPFoASS+ODCxRpEfXEt3/OGAbw85Os4cz82/fm9poVFGu4Wpqmv7OEF+yMFbsN7L tob/WdeOCvDRxT9m+WCA5LczmkhH4TBoVu5LI3FrLX7B0Rs0I2lmGJHXfvqgj/FzadCL lMwy0yKyo1LKLUWlqkMQraYaaG7MxrJS83/tA47bVfnIt0OfOD13o9NMGIcIWLNXyv3p UI6edopsko/Llp/OQCaq7lrpXTF7M44xPsJkkL2DkxhG9H1yQ05GJLS3APZpZxS0HYPe Fsgw== X-Gm-Message-State: ABUngvdrXMfETodWy8H0uRmEInQXfbJAm9HxsxIOEjj38qfuWAyTho+1EMIi687dVE3/6K7hFkKLceDvg/gLwrvq X-Received: by 10.202.2.212 with SMTP id 203mr3632104oic.170.1478100706335; Wed, 02 Nov 2016 08:31:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.183.13.228 with HTTP; Wed, 2 Nov 2016 08:31:25 -0700 (PDT) In-Reply-To: <20161102143100.GU3541@tucnak.redhat.com> References: <20161102143100.GU3541@tucnak.redhat.com> From: Jason Merrill Date: Wed, 02 Nov 2016 15:31:00 -0000 Message-ID: Subject: Re: [PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those To: Jakub Jelinek Cc: Alexandre Oliva , Keith Seitz , Jan Kratochvil , Pierre-Marie de Rodat , gcc-patches List Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00197.txt.bz2 On Wed, Nov 2, 2016 at 10:31 AM, Jakub Jelinek wrote: > It uses Alex' LANG_HOOKS_GET_PTRMEMFN_TYPE langhook. I've tried > to think about https://gcc.gnu.org/ml/gcc-patches/2011-05/msg00227.html > and we even have such a langhook now, modified_type_die > uses lang_hooks.types.get_debug_type, but > 1) it is just called in modified_type_die and not in > gen_type_die_with_usage, that looks weird How much of a problem is that? modified_type_die calls gen_type_die, does that not cover the cases needed here? > 2) it is used for something Ada-ish I really don't know how to test etc. > to be able to find out if it is safe to call it in > gen_type_die_with_usage too You could find an Ada test that uses the code and verify that the output stays the same? > 3) most importantly, if the C++ version of this langhook would create > OFFSET_TYPE on the fly, I don't know how to ensure effective sharing > of DW_TAG_ptr_to_member_type nodes with the same DW_AT_type > and DW_AT_containing_type; unless the C++ langhook adds some extra > hash table that caches already created OFFSET_TYPEs or something similar, > it would create a new OFFSET_TYPE each time it is called build_offset_type already uses a hash table. > Also, I really don't know how well does GDB (especially older releases) > handle DW_TAG_ptr_to_member_type for PMF, so the patch wraps that currently > with if (dwarf_version >= 5). Quick grep revealed that GDB has code to > handle the __pfn/__delta fields. So, can I ask somebody from the GDB > team to test this patch with that if (dwarf_version >= 5) replaced > with if (1) and see if it works properly with current GDB as well as say > 4-5 years old one (e.g. with -gdwarf-2 or -gdwarf-3)? If yes, we > should emit it unconditionally. This all makes sense to me. > + if (dwarf_version >= 5) > + { > + tree class_type = lang_hooks.types.get_ptrmemfn_type (type, 0); > + if (class_type != NULL_TREE) This can be if (dwarf_version >= 5) if (tree class_type = lang_hooks.types.get_ptrmemfn_type (type, 0)) Jason