public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Do not use FP reg when on AAPCS
@ 2018-10-23 13:03 Marius Muench
  2018-10-23 17:16 ` Kevin Buettner
  0 siblings, 1 reply; 9+ messages in thread
From: Marius Muench @ 2018-10-23 13:03 UTC (permalink / raw)
  To: gdb-patches

Hi all,

GDB tries to dereference the frame pointer in arm_scan_prologue as a
last resort to create frame information.
However, the more recent AAPCS ABI does not make use of a frame pointer.

This patch checks whether the specified arm_abi is AAPCS before
dereferencing the "frame pointer". If so, just return as efforts to use
it for restoring frame information won't work.

Cheers,
Marius

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

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

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 53eee76926..859ce71d6a 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))

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

end of thread, other threads:[~2018-11-06 17:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23 13:03 [PATCH] ARM: Do not use FP reg when on AAPCS Marius Muench
2018-10-23 17:16 ` Kevin Buettner
2018-10-24 11:40   ` Marius Muench
2018-10-24 16:47     ` Kevin Buettner
2018-10-24 17:23     ` Pedro Alves
2018-10-24 19:37       ` Marius Muench
2018-10-25 20:34         ` Kevin Buettner
2018-10-26 12:13           ` Marius Muench
2018-11-06 17:53             ` Tom Tromey

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