Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [patch] Arm frame alignment
Date: Tue, 07 Mar 2006 21:40:00 -0000	[thread overview]
Message-ID: <200603071934.42376.paul@codesourcery.com> (raw)

The patch below makes the Arm target code use the frame_align callback instead 
of aligning the stack in arm_push_dummy_call.

Tested with cross to arm-none-eabi.
Ok?

Paul

2006-03-07  Paul Brook  <paul@codesourcery.com>

	* arm-tdep.c (arm_push_dummy_call): Remove stack alignment.
	(arm_frame_align): New function.
	(arm_gdbarch_init): Use it.

Index: gdb/arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.205
diff -u -p -r1.205 arm-tdep.c
--- gdb/arm-tdep.c	15 Feb 2006 17:36:11 -0000	1.205
+++ gdb/arm-tdep.c	7 Mar 2006 19:33:02 -0000
@@ -1173,11 +1173,6 @@ arm_push_dummy_call (struct gdbarch *gdb
   argreg = ARM_A1_REGNUM;
   nstack = 0;
 
-  /* Some platforms require a double-word aligned stack.  Make sure sp
-     is correctly aligned before we start.  We always do this even if
-     it isn't really needed -- it can never hurt things.  */
-  sp &= ~(CORE_ADDR)(2 * DEPRECATED_REGISTER_SIZE - 1);
-
   /* The struct_return pointer occupies the first parameter
      passing register.  */
   if (struct_return)
@@ -1299,6 +1294,17 @@ arm_push_dummy_call (struct gdbarch *gdb
   return sp;
 }
 
+
+/* Always align the frame to an 8-byte boundary.  This is required on
+   some platforms and harmless on the rest.  */
+
+static CORE_ADDR
+arm_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+  /* Align the stack to eight bytes.  */
+  return sp & ~ (CORE_ADDR) 7;
+}
+
 static void
 print_fpu_flags (int flags)
 {
@@ -2738,6 +2744,7 @@ arm_gdbarch_init (struct gdbarch_info in
   tdep->jb_pc = -1;	/* Longjump support not enabled by default.  */
 
   set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
+  set_gdbarch_frame_align (gdbarch, arm_frame_align);
 
   set_gdbarch_write_pc (gdbarch, arm_write_pc);
 


             reply	other threads:[~2006-03-07 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-07 21:40 Paul Brook [this message]
2006-03-08 17:26 ` Richard Earnshaw
2006-03-09  0:20   ` Paul Brook

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=200603071934.42376.paul@codesourcery.com \
    --to=paul@codesourcery.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