public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m
@ 2022-11-23 11:47 Torbjörn SVENSSON
  2022-11-23 11:56 ` Luis Machado
  0 siblings, 1 reply; 2+ messages in thread
From: Torbjörn SVENSSON @ 2022-11-23 11:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: luis.machado, Torbjörn SVENSSON

For v8m, the EXC_RETURN pattern, without security extension, consists of
FType, Mode and SPSEL.  These are the same bits that are used in v7m.
This patch extends the list of patterns to include also the FType bit
and not just Mode and SPSEL bits for v8m targets without security
extension.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gdb/arm-tdep.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index a839f957440..742b8e1f64b 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -834,7 +834,19 @@ arm_m_addr_is_lockup (CORE_ADDR addr)
    EXC_RETURN    Condition
    0xFFFFFFB0    Return to Handler mode.
    0xFFFFFFB8    Return to Thread mode using the main stack.
-   0xFFFFFFBC    Return to Thread mode using the process stack.  */
+   0xFFFFFFBC    Return to Thread mode using the process stack.
+
+   The above list is incomplete as it does not include the FType bit.  The
+   complete list for ARMv8-M is:
+
+   EXC_RETURN    Condition
+   0xFFFFFFA0    Return to Handler mode, standard frame.
+   0xFFFFFFA8    Return to Thread mode using the main stack, standard frame.
+   0xFFFFFFAC    Return to Thread mode using the process stack, standard frame.
+   0xFFFFFFB0    Return to Handler mode, extended frame.
+   0xFFFFFFB8    Return to Thread mode using the main stack, extended frame.
+   0xFFFFFFBC    Return to Thread mode using the process stack, extended frame.
+   */
 
 static int
 arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
@@ -859,6 +871,9 @@ arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
       switch (addr)
 	{
 	  /* Values from ARMv8-M Architecture Technical Reference.  */
+	case 0xffffffa0:
+	case 0xffffffa8:
+	case 0xffffffac:
 	case 0xffffffb0:
 	case 0xffffffb8:
 	case 0xffffffbc:
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m
  2022-11-23 11:47 [PATCH] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m Torbjörn SVENSSON
@ 2022-11-23 11:56 ` Luis Machado
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Machado @ 2022-11-23 11:56 UTC (permalink / raw)
  To: Torbjörn SVENSSON, gdb-patches

Hi Torbjörn,

Thanks for the patch.

On 11/23/22 11:47, Torbjörn SVENSSON wrote:
> For v8m, the EXC_RETURN pattern, without security extension, consists of
> FType, Mode and SPSEL.  These are the same bits that are used in v7m.
> This patch extends the list of patterns to include also the FType bit
> and not just Mode and SPSEL bits for v8m targets without security
> extension.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>   gdb/arm-tdep.c | 17 ++++++++++++++++-
>   1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index a839f957440..742b8e1f64b 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -834,7 +834,19 @@ arm_m_addr_is_lockup (CORE_ADDR addr)
>      EXC_RETURN    Condition
>      0xFFFFFFB0    Return to Handler mode.
>      0xFFFFFFB8    Return to Thread mode using the main stack.
> -   0xFFFFFFBC    Return to Thread mode using the process stack.  */
> +   0xFFFFFFBC    Return to Thread mode using the process stack.
> +
> +   The above list is incomplete as it does not include the FType bit.  The
> +   complete list for ARMv8-M is:

I'd just add the missing entries to the list, therefore making the list complete, update the existing
entries like you did and mention we need to consider the FType bit for v8-m.

> +
> +   EXC_RETURN    Condition
> +   0xFFFFFFA0    Return to Handler mode, standard frame.
> +   0xFFFFFFA8    Return to Thread mode using the main stack, standard frame.
> +   0xFFFFFFAC    Return to Thread mode using the process stack, standard frame.
> +   0xFFFFFFB0    Return to Handler mode, extended frame.
> +   0xFFFFFFB8    Return to Thread mode using the main stack, extended frame.
> +   0xFFFFFFBC    Return to Thread mode using the process stack, extended frame.
> +   */
>   
>   static int
>   arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
> @@ -859,6 +871,9 @@ arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
>         switch (addr)
>   	{
>   	  /* Values from ARMv8-M Architecture Technical Reference.  */
> +	case 0xffffffa0:
> +	case 0xffffffa8:
> +	case 0xffffffac:
>   	case 0xffffffb0:
>   	case 0xffffffb8:
>   	case 0xffffffbc:

With the comment update, this is OK.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-23 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 11:47 [PATCH] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m Torbjörn SVENSSON
2022-11-23 11:56 ` Luis Machado

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).