ARM: Do not use FP reg when on AAPCS

Message ID 15364ecd-125d-7196-8e83-e6db60127005@eurecom.fr
State New, archived
Headers

Commit Message

Marius Muench Oct. 24, 2018, 7:37 p.m. UTC
  On 10/24/2018 07:23 PM, Pedro Alves wrote:
> Tiny nit:
>
> On 10/24/2018 12:40 PM, Marius Muench wrote:
>>
>> +      /* AAPCS does not use a frame register, so we can abort here. */
>
> There should be a double space after the period.
>
>> +      if (gdbarch_tdep (gdbarch)->arm_abi == ARM_ABI_AAPCS)
>> +        return;
>
> Thanks,
> Pedro Alves
>

Fair enough, updated version below.

gdb/ChangeLog:
2018-10-24  Marius Muench  <marius.muench@eurecom.fr>

       * arm-tdep.c (arm_scan_prologue): Don't dereference FP reg
       when on AAPCS.
---
 gdb/arm-tdep.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Kevin Buettner Oct. 25, 2018, 8:34 p.m. UTC | #1
On Wed, 24 Oct 2018 21:37:07 +0200
Marius Muench <marius.muench@eurecom.fr> wrote:

> Fair enough, updated version below.
> 
> gdb/ChangeLog:
> 2018-10-24  Marius Muench  <marius.muench@eurecom.fr>
> 
>        * arm-tdep.c (arm_scan_prologue): Don't dereference FP reg
>        when on AAPCS.

Looks good to me.

You can commit / push this now...

Kevin
  
Marius Muench Oct. 26, 2018, 12:13 p.m. UTC | #2
Thanks! I don't have push permissions, as it is my first contribution to
this project.
I can't find any documentation what to do in this case, scraping the ML,
I see three possible strategies:

(1) One of you push on my behalf.
(2) I send a new (clean) version of this patch, which gets pushed on my
behalf.
(3) Push permissions are set up.

What's your preferred strategy here?

Thanks a lot,
Marius


On 10/25/18 10:34 PM, Kevin Buettner wrote:
> On Wed, 24 Oct 2018 21:37:07 +0200
> Marius Muench <marius.muench@eurecom.fr> wrote:
> 
>> Fair enough, updated version below.
>>
>> gdb/ChangeLog:
>> 2018-10-24  Marius Muench  <marius.muench@eurecom.fr>
>>
>>        * arm-tdep.c (arm_scan_prologue): Don't dereference FP reg
>>        when on AAPCS.
> 
> Looks good to me.
> 
> You can commit / push this now...
> 
> Kevin
>
  
Tom Tromey Nov. 6, 2018, 5:53 p.m. UTC | #3
>>>>> "Marius" == Marius Muench <munch@eurecom.fr> writes:

Marius> Thanks! I don't have push permissions, as it is my first contribution to
Marius> this project.
Marius> I can't find any documentation what to do in this case, scraping the ML,
Marius> I see three possible strategies:

Marius> (1) One of you push on my behalf.

Sorry about the delay on this.
I am pushing it now.

Marius> (2) I send a new (clean) version of this patch, which gets pushed on my
Marius> behalf.
Marius> (3) Push permissions are set up.

If you plan to do more work on gdb, you should consider getting
write-after-approval access.  I think copyright paperwork is needed
first though.

Tom
  

Patch

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 53eee76926..0165e92527 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1801,6 +1801,10 @@  arm_scan_prologue (struct frame_info *this_frame,
       CORE_ADDR frame_loc;
       ULONGEST return_value;

+      /* AAPCS does not use a frame register, so we can abort here.  */
+      if (gdbarch_tdep (gdbarch)->arm_abi == ARM_ABI_AAPCS)
+        return;
+
       frame_loc = get_frame_register_unsigned (this_frame, ARM_FP_REGNUM);
       if (!safe_read_memory_unsigned_integer (frame_loc, 4, byte_order,
                                              &return_value))