Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org>
Cc: aburgess@redhat.com, Tim Wiederhake <tim.wiederhake@intel.com>,
	Bernhard Heckel <bernhard.heckel@intel.com>,
	jinisusan.george@amd.com, tom@tromey.com
Subject: Re: [PATCH v4 3/3] dwarf, fortran: add support for DW_TAG_entry_point
Date: Fri, 15 Jul 2022 13:56:34 -0600	[thread overview]
Message-ID: <87pmi6m9ot.fsf@tromey.com> (raw)
In-Reply-To: <20220713111226.2693410-4-nils-christian.kempke@intel.com> (Nils-Christian Kempke via Gdb-patches's message of "Wed, 13 Jul 2022 13:12:26 +0200")

>>>>> Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org> writes:

> Fortran provides additional entry points for subroutines and functions.
> These entry points may use only a subset (or a different set) of the
> parameters of the original subroutine.  The entry points may be described
> via the DWARF tag DW_TAG_entry_point.

> @@ -21797,12 +21852,15 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
>  	return "";
>        case DW_TAG_subprogram:
>  	/* Nested subroutines in Fortran get a prefix with the name
> -	   of the parent's subroutine.  */
> +	   of the parent's subroutine.  Entry points are prefixed by the
> +	   parent's namespace.  */
>  	if (cu->lang () == language_fortran)
>  	  {
>  	    if ((die->tag ==  DW_TAG_subprogram)
>  		&& (dwarf2_name (parent, cu) != NULL))
>  	      return dwarf2_name (parent, cu);
> +	    else if (die->tag == DW_TAG_entry_point)
> +	      return determine_prefix (parent, cu);
>  	  }

It seems to me that this will also need a special case in
cooked_indexer::index_dies to ensure that the cooked_index_entry for the
entry point has the correct parent.  Parent relationships are how name
components are determined there, so IIUC the entry point's parent should
be the same as the subroutine's parent -- not the subroutine itself.

One way to see whether this works is to write a .gdb_index and then dump
it and examine the resulting name of the entry point.

thanks,
Tom

  reply	other threads:[~2022-07-15 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 11:12 [PATCH v4 0/3] Fortran entry and DW_TAG_entry_point Nils-Christian Kempke via Gdb-patches
2022-07-13 11:12 ` [PATCH v4 1/3] gdb, dwarf: move part of dwarf2_get_pc_bounds into separate function Nils-Christian Kempke via Gdb-patches
2022-07-13 11:12 ` [PATCH v4 2/3] gdb, dwarf: add assert to dwarf2_get_pc_bounds Nils-Christian Kempke via Gdb-patches
2022-07-13 11:12 ` [PATCH v4 3/3] dwarf, fortran: add support for DW_TAG_entry_point Nils-Christian Kempke via Gdb-patches
2022-07-15 19:56   ` Tom Tromey [this message]
2022-08-08 16:52     ` Kempke, Nils-Christian via Gdb-patches

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=87pmi6m9ot.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=aburgess@redhat.com \
    --cc=bernhard.heckel@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jinisusan.george@amd.com \
    --cc=tim.wiederhake@intel.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