public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m
@ 2022-11-23 12:17 Torbjörn SVENSSON
  2022-11-23 12:46 ` Luis Machado
  0 siblings, 1 reply; 3+ messages in thread
From: Torbjörn SVENSSON @ 2022-11-23 12:17 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 | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index a839f957440..f466b5938e4 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -828,13 +828,17 @@ arm_m_addr_is_lockup (CORE_ADDR addr)
    For more details see "B1.5.8 Exception return behavior"
    in both ARMv6-M and ARMv7-M Architecture Reference Manuals.
 
-   In the ARMv8-M Architecture Technical Reference also adds
-   for implementations without the Security Extension:
+   From ARMv8-M Architecture Technical Reference, D1.2.95
+   FType, Mode and SPSEL bits are to be considerd when Security Extension is
+   not implemented.
 
-   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.  */
+   EXC_RETURN    Return To        Return Stack    Frame Type
+   0xFFFFFFA0    Handler mode     Main            Extended
+   0xFFFFFFA8    Thread mode      Main            Extended
+   0xFFFFFFAC    Thread mode      Process         Extended
+   0xFFFFFFB0    Handler mode     Main            Standard
+   0xFFFFFFB8    Thread mode      Main            Standard
+   0xFFFFFFBC    Thread mode      Process         Standard  */
 
 static int
 arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
@@ -859,6 +863,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] 3+ messages in thread

* Re: [PATCH v2] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m
  2022-11-23 12:17 [PATCH v2] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m Torbjörn SVENSSON
@ 2022-11-23 12:46 ` Luis Machado
  2022-11-23 13:17   ` Torbjorn SVENSSON
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2022-11-23 12:46 UTC (permalink / raw)
  To: Torbjörn SVENSSON, gdb-patches

On 11/23/22 12:17, 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 | 19 +++++++++++++------
>   1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index a839f957440..f466b5938e4 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -828,13 +828,17 @@ arm_m_addr_is_lockup (CORE_ADDR addr)
>      For more details see "B1.5.8 Exception return behavior"
>      in both ARMv6-M and ARMv7-M Architecture Reference Manuals.
>   
> -   In the ARMv8-M Architecture Technical Reference also adds
> -   for implementations without the Security Extension:
> +   From ARMv8-M Architecture Technical Reference, D1.2.95
> +   FType, Mode and SPSEL bits are to be considerd when Security Extension is

considerd -> considered
when -> when the

> +   not implemented.
>   
> -   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.  */
> +   EXC_RETURN    Return To        Return Stack    Frame Type
> +   0xFFFFFFA0    Handler mode     Main            Extended
> +   0xFFFFFFA8    Thread mode      Main            Extended
> +   0xFFFFFFAC    Thread mode      Process         Extended
> +   0xFFFFFFB0    Handler mode     Main            Standard
> +   0xFFFFFFB8    Thread mode      Main            Standard
> +   0xFFFFFFBC    Thread mode      Process         Standard  */
>   
>   static int
>   arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
> @@ -859,6 +863,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:

OK with the above addressed.

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

* Re: [PATCH v2] gdb/arm: Include FType bit in EXC_RETURN pattern on v8m
  2022-11-23 12:46 ` Luis Machado
@ 2022-11-23 13:17   ` Torbjorn SVENSSON
  0 siblings, 0 replies; 3+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-23 13:17 UTC (permalink / raw)
  To: Luis Machado, gdb-patches



On 2022-11-23 13:46, Luis Machado wrote:
> On 11/23/22 12:17, 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 | 19 +++++++++++++------
>>   1 file changed, 13 insertions(+), 6 deletions(-)
>>
>> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
>> index a839f957440..f466b5938e4 100644
>> --- a/gdb/arm-tdep.c
>> +++ b/gdb/arm-tdep.c
>> @@ -828,13 +828,17 @@ arm_m_addr_is_lockup (CORE_ADDR addr)
>>      For more details see "B1.5.8 Exception return behavior"
>>      in both ARMv6-M and ARMv7-M Architecture Reference Manuals.
>> -   In the ARMv8-M Architecture Technical Reference also adds
>> -   for implementations without the Security Extension:
>> +   From ARMv8-M Architecture Technical Reference, D1.2.95
>> +   FType, Mode and SPSEL bits are to be considerd when Security 
>> Extension is
> 
> considerd -> considered
> when -> when the
> 
>> +   not implemented.
>> -   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.  */
>> +   EXC_RETURN    Return To        Return Stack    Frame Type
>> +   0xFFFFFFA0    Handler mode     Main            Extended
>> +   0xFFFFFFA8    Thread mode      Main            Extended
>> +   0xFFFFFFAC    Thread mode      Process         Extended
>> +   0xFFFFFFB0    Handler mode     Main            Standard
>> +   0xFFFFFFB8    Thread mode      Main            Standard
>> +   0xFFFFFFBC    Thread mode      Process         Standard  */
>>   static int
>>   arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr)
>> @@ -859,6 +863,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:
> 
> OK with the above addressed.


Pushed.

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

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

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

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