Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: "Fredrik Hederstierna" <fredrik.hederstierna@verisure.com>
Cc: gdb-patches@sourceware.org,  Yao Qi <qiyaoltc@gmail.com>
Subject: Re: [PATCH] Fix exception unwinding for ARM Cortex-M
Date: Tue, 02 Aug 2016 16:01:00 -0000	[thread overview]
Message-ID: <864m73dutq.fsf@gmail.com> (raw)
In-Reply-To: <OF1926033E.B8166B2F-ON00258003.003441A6-00258003.003556EF@notes.na.collabserv.com>	(Fredrik Hederstierna's message of "Tue, 2 Aug 2016 09:42:36 +0000")

"Fredrik Hederstierna" <fredrik.hederstierna@verisure.com> writes:

Hi Fredrik,
Thanks for splitting the patch.

> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 7820302..2c8573c 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,7 @@
> +2016-08-02  Fredrik Hederstierna  <fredrik.hederstierna@verisure.com>
> +
> +	* arm-tdep.c: Fix EXC_RETURN values for ARMv6-M and ARMv7-M.
> +

ChangeLog entry should cover what do you change on the function level.
Please read https://sourceware.org/gdb/wiki/ContributionChecklist

>  2016-08-01  Joel Brobecker  <brobecker@adacore.com>
>  
>  	* NEWS: Create a new section for the next release branch.
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index d2661cb..43436df 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -469,9 +469,11 @@ static CORE_ADDR
>  arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val)
>  {
>    /* On M-profile devices, do not strip the low bit from EXC_RETURN
> -     (the magic exception return address).  */
> +     (the magic exception return address).
> +     According to B1.5.8 of both the ARMv6-M and ARMv7-M Reference Manuals
> +     the EXC_RETURN value is 0xF in Bits[31:28].  */
>    if (gdbarch_tdep (gdbarch)->is_m
> -      && (val & 0xfffffff0) == 0xfffffff0)
> +      && (val & 0xf0000000) == 0xf0000000)


Let us do the strict checking.  In ARMv7-M manual, the pseudo code of 
ExceptionReturn(bits(28) EXC_RETURN) has

if HaveFPExt() then
if !IsOnes(EXC_RETURN<27:5>) then UNPREDICTABLE;
else
if !IsOnes(EXC_RETURN<27:4>) then UNPREDICTABLE;

so let's check "val" should be 0xFFFFFF{E,F}{1,9,D}, or use
arm_m_pc_is_magic too, like,

       if (gdbarch_tdep (gdbarch)->is_m
           && arm_m_pc_is_magic (val))
          return val;

Do you have FSF copyright assignment?  I don't find your record.  You
can fill in the form request-assign.future in
https://sourceware.org/gdb/wiki/ContributionChecklist#FSF_copyright_Assignment
then, we can pick up your change.

-- 
Yao (齐尧)


  reply	other threads:[~2016-08-02 16:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF625831A6.9C918507-ON00257FFE.0029D369-00257FFE.002D2551@notes.na.collabserv.com>
2016-07-29 11:47 ` Yao Qi
2016-08-02  9:43 ` Fredrik Hederstierna
2016-08-02 16:01   ` Yao Qi [this message]
2016-08-03 10:56   ` Fredrik Hederstierna
2016-08-03 11:19     ` Yao Qi
2016-08-03 17:33     ` James-Adam Renquinha Henri
2016-08-04  7:04     ` Fredrik Hederstierna
2016-08-05 19:02       ` Adam Renquinha
2016-08-09  9:17         ` Yao Qi
2016-09-23 17:32           ` Adam Renquinha
2016-09-26  3:03             ` Yao Qi
2016-09-27  1:38               ` Adam Renquinha
2016-09-27  4:40                 ` Yao Qi
     [not found] <AM4PR1001MB0948AC4D9CB635F5A9A2FC82EFDC0@AM4PR1001MB0948.EURPRD10.PROD.OUTLOOK.COM>
     [not found] ` <HE1PR1001MB130613C0995C4C21A630373BEF1B0@HE1PR1001MB1306.EURPRD10.PROD.OUTLOOK.COM>
2019-06-10 21:25   ` James-Adam Renquinha Henri
2019-06-12  9:01     ` Alan Hayward

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=864m73dutq.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=fredrik.hederstierna@verisure.com \
    --cc=gdb-patches@sourceware.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