summaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-09-18 15:37:18 +0000
committerAndrew Cagney <cagney@redhat.com>2002-09-18 15:37:18 +0000
commit301a18620e43dfe8e5116907094da7db9f7f7395 (patch)
tree6c5d546149e692bbb3ae25cdeea0ad86c40b7833 /gdb/mips-tdep.c
parent39956be8b009f03b14b974d8e59cb07272a4b1a0 (diff)
downloadgdb-301a18620e43dfe8e5116907094da7db9f7f7395.tar.gz
2002-09-18 Andrew Cagney <ac131313@redhat.com>
* valops.c (hand_function_call): Align the initial stack pointer and STRUCT_ADDR using frame_align. When STRUCT_RETURN and FRAME_ALIGN_P, use STRUCT_ADDR to obtain the called function's return value. * mips-tdep.c (mips_frame_align): New function. (mips_gdbarch_init): Set frame_align. * gdbarch.sh (FRAME_ALIGN): New method. * gdbarch.h, gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 79b189cb187..f54f19c2ad7 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -2584,6 +2584,14 @@ mips_type_needs_double_align (struct type *type)
#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
+/* Adjust the address downward (direction of stack growth) so that it
+ is correctly aligned for a new stack frame. */
+static CORE_ADDR
+mips_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ return ROUND_DOWN (addr, 16);
+}
+
static CORE_ADDR
mips_eabi_push_arguments (int nargs,
struct value **args,
@@ -5963,6 +5971,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
set_gdbarch_push_return_address (gdbarch, mips_push_return_address);
+ set_gdbarch_frame_align (gdbarch, mips_frame_align);
set_gdbarch_register_convertible (gdbarch, mips_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch,
mips_register_convert_to_virtual);