Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: <srinath.parvathaneni@arm.com>
Cc: <gdb-patches@sourceware.org>,  <luis.machado.foss@gmail.com>,
	<guinevere@redhat.com>,  <Ezra.Sitorus@arm.com>,
	<Matthieu.Longo@arm.com>
Subject: Re: [PATCH v2 6/7] gdb/aarch64: Add core file support for FEAT_S1POE
Date: Mon, 29 Jun 2026 02:44:03 +0000	[thread overview]
Message-ID: <87tsqmkqvg.fsf@linaro.org> (raw)
In-Reply-To: <20260626180821.376406-7-srinath.parvathaneni@arm.com> (srinath parvathaneni's message of "Fri, 26 Jun 2026 18:08:20 +0000")

<srinath.parvathaneni@arm.com> writes:

> From: Srinath Parvathaneni <srinath.parvathaneni@arm.com>
>
> Add support for POR_EL0 dumps/reads for core files.

This descriptions is incomplete. The patch is also about adding support
for reading the POE value in the signal frame.

> ---
>  gdb/aarch64-linux-tdep.c | 51 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>
> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
> index b8a02ab9972..1d6d4c94b84 100644
> --- a/gdb/aarch64-linux-tdep.c
> +++ b/gdb/aarch64-linux-tdep.c
> @@ -171,6 +171,7 @@
>  #define AARCH64_ZT_MAGIC			0x5a544e01
>  #define AARCH64_GCS_MAGIC			0x47435300
>  #define AARCH64_FPMR_MAGIC			0x46504d52
> +#define AARCH64_POE_MAGIC			0x504f4530
>  
>  /* Defines for the extra_context that follows an AARCH64_EXTRA_MAGIC.  */
>  #define AARCH64_EXTRA_DATAP_OFFSET		8
> @@ -220,6 +221,9 @@
>  /* FPMR constants.  */
>  #define AARCH64_FPMR_OFFSET			8
>  
> +/* POE constants.  */
> +#define AARCH64_POE_OFFSET			8
> +
>  /* Holds information about the signal frame.  */
>  struct aarch64_linux_sigframe
>  {
> @@ -273,6 +277,11 @@ struct aarch64_linux_sigframe
>    /* FPMR value.  */
>    CORE_ADDR fpmr = 0;
>  
> +  /* True if we have an POE entry in the signal context, false otherwise.  */
> +  bool poe_available = false;
> +  /* FPMR value.  */
> +  CORE_ADDR poe = 0;
> +

Extraneous empty line.

>  };
>  
>  /* Read an aarch64_ctx, returning the magic value, and setting *SIZE to the
> @@ -605,6 +614,22 @@ aarch64_linux_read_signal_frame_info (const frame_info_ptr &this_frame,
>  	    section += size;
>  	    break;
>  	  }
> +	case AARCH64_POE_MAGIC:
> +	  {
> +	    gdb_byte buf[8];
> +	    if (target_read_memory (section + AARCH64_POE_OFFSET,
> +				    buf, 8) != 0)
> +	      {
> +		warning (_("Failed to read the POE section address from the"
> +			   " signal frame context."));
> +		section += size;
> +		break;
> +	      }
> +	    signal_frame.poe = extract_unsigned_integer (buf, 8, byte_order);
> +	    signal_frame.poe_available = true;
> +	    section += size;
> +	    break;
> +	  }
>  	case AARCH64_EXTRA_MAGIC:
>  	  {
>  	    /* Extra is always the last valid section in reserved and points to
> @@ -775,6 +800,13 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self,
>  			      signal_frame.fpmr);
>    }
>  
> +  /* Handle POE register.  */
> +  if (tdep->has_poe () && signal_frame.poe_available != 0)

poe_available is a boolean, so you can just use "&&
signal_frame.poe_available".

> +  {
> +    trad_frame_set_reg_value (this_cache, tdep->poe_regnum,
> +			      signal_frame.poe);
> +  }
> +
>    /* Restore the tpidr2 register, if the target supports it and if there is
>       an entry for it.  */
>    if (signal_frame.tpidr2_section != 0 && tdep->has_tls ()

-- 
Thiago
(he/him)

  reply	other threads:[~2026-06-29  2:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 18:08 [PATCH v2 0/7] gdb/aarch64: Add support for FEAT_S1POE feature srinath.parvathaneni
2026-06-26 18:08 ` [PATCH v2 1/7] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE srinath.parvathaneni
2026-06-27  6:06   ` Thiago Jung Bauermann
2026-06-29 10:44     ` Srinath Parvathaneni
2026-07-01  5:16       ` Thiago Jung Bauermann
2026-07-01 14:45         ` Marc Zyngier
2026-06-26 18:08 ` [PATCH v2 2/7] gdb/aarch64: Add custom printing for POR_EL0 srinath.parvathaneni
2026-06-27  7:03   ` Thiago Jung Bauermann
2026-06-29  7:02     ` Srinath Parvathaneni
2026-06-29 15:58       ` Ezra Sitorus
2026-06-26 18:08 ` [PATCH v2 3/7] gdb: Improve SIGSEGV diagnostics for POE faults srinath.parvathaneni
2026-06-29  2:42   ` Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 4/7] gdbserver/aarch64: Add POR_EL0 register support srinath.parvathaneni
2026-06-29  2:43   ` Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 5/7] bfd/readelf: Add core file support for FEAT_S1POE srinath.parvathaneni
2026-06-29  2:43   ` Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 6/7] gdb/aarch64: " srinath.parvathaneni
2026-06-29  2:44   ` Thiago Jung Bauermann [this message]
2026-06-26 18:08 ` [PATCH v2 7/7] gdb/testsuite: Add FEAT_S1POE testcases srinath.parvathaneni
2026-07-01  5:12   ` Thiago Jung Bauermann
2026-06-29 12:18 ` [PATCH v2 0/7] gdb/aarch64: Add support for FEAT_S1POE feature Guinevere Larsen

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=87tsqmkqvg.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=Ezra.Sitorus@arm.com \
    --cc=Matthieu.Longo@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=luis.machado.foss@gmail.com \
    --cc=srinath.parvathaneni@arm.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