public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Alexandre Oliva <aoliva@redhat.com>,
	Keith Seitz <keiths@redhat.com>,
		Jan Kratochvil <jan.kratochvil@redhat.com>,
	Pierre-Marie de Rodat <derodat@adacore.com>,
		gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those
Date: Wed, 02 Nov 2016 15:31:00 -0000	[thread overview]
Message-ID: <CADzB+2=MjeQ-W3vrDSDRVhbuFhgJQZJ3wFBMv0rz=3A8YATTmw@mail.gmail.com> (raw)
In-Reply-To: <20161102143100.GU3541@tucnak.redhat.com>

On Wed, Nov 2, 2016 at 10:31 AM, Jakub Jelinek <jakub@redhat.com> 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

  reply	other threads:[~2016-11-02 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 14:31 Jakub Jelinek
2016-11-02 15:31 ` Jason Merrill [this message]
2016-11-02 15:44   ` Jakub Jelinek
2016-11-02 16:33     ` Jakub Jelinek
2016-11-02 17:19       ` Jason Merrill
2016-11-03 16:39         ` [PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those (take 2) Jakub Jelinek
2016-11-03 19:54           ` Jason Merrill
2016-11-03 17:31       ` [PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those Pierre-Marie de Rodat

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='CADzB+2=MjeQ-W3vrDSDRVhbuFhgJQZJ3wFBMv0rz=3A8YATTmw@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=derodat@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=keiths@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).