Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis <luis.machado.foss@gmail.com>
To: Ezra.Sitorus@arm.com, gdb-patches@sourceware.org
Cc: thiago.bauermann@linaro.org
Subject: Re: [PATCH v2 3/5] gdb/aarch64: signal frame support for fpmr
Date: Sat, 11 Oct 2025 13:15:19 +0100	[thread overview]
Message-ID: <ac881f00-4d1a-47f9-9da4-e978d4f6ecbe@gmail.com> (raw)
In-Reply-To: <20251007123132.26769-4-Ezra.Sitorus@arm.com>

On 07/10/2025 13:31, Ezra.Sitorus@arm.com wrote:
> From: Ezra Sitorus <ezra.sitorus@arm.com>
> 
> Add support for FPMR in signal frames and restore contents of FPMR.
> ---
> Changes from v1->v2:
> * Addressed comments/whitespace/formatting issues
> 
> Ezra
> 
>   gdb/aarch64-linux-tdep.c | 34 ++++++++++++++++++++++++++++++++++
>   1 file changed, 34 insertions(+)
> 
> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
> index 10b44d978af..e905be40a8d 100644
> --- a/gdb/aarch64-linux-tdep.c
> +++ b/gdb/aarch64-linux-tdep.c
> @@ -167,6 +167,7 @@
>   #define AARCH64_TPIDR2_MAGIC			0x54504902
>   #define AARCH64_ZT_MAGIC			0x5a544e01
>   #define AARCH64_GCS_MAGIC			0x47435300
> +#define AARCH64_FPMR_MAGIC			0x46504d52
>   
>   /* Defines for the extra_context that follows an AARCH64_EXTRA_MAGIC.  */
>   #define AARCH64_EXTRA_DATAP_OFFSET		8
> @@ -213,6 +214,9 @@
>   /* features_enabled value offset in the GCS signal frame context.  */
>   #define AARCH64_GCS_CONTEXT_FEATURES_ENABLED_OFFSET	16
>   
> +/* FPMR constants. */
> +#define AARCH64_FPMR_OFFSET			8
> +
>   /* Holds information about the signal frame.  */
>   struct aarch64_linux_sigframe
>   {
> @@ -260,6 +264,12 @@ struct aarch64_linux_sigframe
>     uint64_t gcspr;
>     /* Flags indicating which GCS features are enabled for the thread.  */
>     uint64_t gcs_features_enabled;
> +
> +  /* True if we have an FPMR entry in the signal context, false otherwise.  */
> +  bool fpmr_available = false;
> +  /* The Floating Point Mode Register.  */
> +  CORE_ADDR fpmr = 0;
> +
>   };
>   
>   /* Read an aarch64_ctx, returning the magic value, and setting *SIZE to the
> @@ -576,6 +586,22 @@ aarch64_linux_read_signal_frame_info (const frame_info_ptr &this_frame,
>   	    section += size;
>   	    break;
>   	  }
> +	case AARCH64_FPMR_MAGIC:
> +	  {
> +	    gdb_byte buf[8];
> +	    if (target_read_memory (section + AARCH64_FPMR_OFFSET,
> +				    buf, 8) != 0)
> +	      {
> +		warning (_("Failed to read the FPMR section address from the"
> +			   " signal frame context."));
> +		section += size;
> +		break;
> +	      }
> +	    signal_frame.fpmr = extract_unsigned_integer (buf, 8, byte_order);
> +	    signal_frame.fpmr_available = true;
> +	    section += size;
> +	    break;
> +	  }
>   	case AARCH64_EXTRA_MAGIC:
>   	  {
>   	    /* Extra is always the last valid section in reserved and points to
> @@ -739,6 +765,13 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self,
>   	}
>       }
>   
> +      /* Handle FPMR.  */

Sorry, missed this one. The above indentation is off. Please fix it.

> +  if (tdep->has_fpmr () && signal_frame.fpmr_available != 0)
> +  {
> +    trad_frame_set_reg_value (this_cache, tdep->fpmr_regnum,
> +			      signal_frame.fpmr);
> +  }
> +

  parent reply	other threads:[~2025-10-11 12:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 12:31 [PATCH v2 0/5] gdb/aarch64: Support for FPMR Ezra.Sitorus
2025-10-07 12:31 ` [PATCH v2 1/5] gdb/aarch64: Enable FPMR for AArch64 in gdb on Linux Ezra.Sitorus
2025-10-11 11:35   ` Luis
2025-10-07 12:31 ` [PATCH v2 2/5] gdbserver/aarch64: Enable FPMR for AArch64 in gdbserver " Ezra.Sitorus
2025-10-11 11:50   ` Luis
2025-10-13 13:40     ` Richard Earnshaw
2025-10-13 14:53       ` Ezra Sitorus
2025-10-16 22:01         ` Luis
2025-10-07 12:31 ` [PATCH v2 3/5] gdb/aarch64: signal frame support for fpmr Ezra.Sitorus
2025-10-11 11:57   ` Luis
2025-10-11 12:15   ` Luis [this message]
2025-10-07 12:31 ` [PATCH v2 4/5] gdb/aarch64: core file support for FPMR Ezra.Sitorus
2025-10-11 12:03   ` Luis
2025-10-07 12:31 ` [PATCH v2 5/5] gdb/aarch64: Tests for fpmr Ezra.Sitorus
2025-10-11 12:53   ` Luis
2025-10-11 12:05 ` [PATCH v2 0/5] gdb/aarch64: Support for FPMR Luis

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=ac881f00-4d1a-47f9-9da4-e978d4f6ecbe@gmail.com \
    --to=luis.machado.foss@gmail.com \
    --cc=Ezra.Sitorus@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=thiago.bauermann@linaro.org \
    /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