This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 08/18] gdb: or1k: change or1k_push_dummy_code stack alignment
- From: Stafford Horne <shorne at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: openrisc at lists dot librecores dot org, Franck Jullien <franck dot jullien at gmail dot com>
- Date: Thu, 24 Nov 2016 07:10:34 +0900
- Subject: [PATCH 08/18] gdb: or1k: change or1k_push_dummy_code stack alignment
- Authentication-results: sourceware.org; auth=none
- References: <1479939044-1341-1-git-send-email-shorne@gmail.com>
From: Franck Jullien <franck.jullien@gmail.com>
gdb/ChangeLog
* or1k-tdep.c (or1k_push_dummy_code) : Use or1k_frame_align to
align the stack pointer.
---
gdb/or1k-tdep.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index cb0871f..81bb541 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -1173,10 +1173,14 @@ or1k_push_dummy_code (struct gdbarch *gdbarch,
CORE_ADDR *bp_addr,
struct regcache *regcache)
{
- /* Allocate space sufficient for a breakpoint, keeping the stack aligned. */
- sp = (sp - 4) & ~15;
+ CORE_ADDR bp_slot;
+
+ /* Reserve enough room on the stack for our breakpoint instruction. */
+ bp_slot = sp - 4;
/* Store the address of that breakpoint */
- *bp_addr = sp;
+ *bp_addr = bp_slot;
+ /* keeping the stack aligned. */
+ sp = or1k_frame_align (gdbarch, bp_slot);
/* The call starts at the callee's entry point. */
*real_pc = function;
--
2.7.4