aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.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
commitdc60453953d816e84c32b10bcc187100ec090206 (patch)
tree4ebb3131ab59d027361b42aa01174a3911a506a0 /gdb/gdbarch.c
parent11350d2a6f73a4a510fa335553e1363857f8b84f (diff)
downloadfsf-binutils-gdb-dc60453953d816e84c32b10bcc187100ec090206.zip
fsf-binutils-gdb-dc60453953d816e84c32b10bcc187100ec090206.tar.gz
fsf-binutils-gdb-dc60453953d816e84c32b10bcc187100ec090206.tar.bz2
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/gdbarch.c')
-rw-r--r--gdb/gdbarch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 5766751..bc27aae 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -244,6 +244,7 @@ struct gdbarch
gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
gdbarch_frame_num_args_ftype *frame_num_args;
gdbarch_stack_align_ftype *stack_align;
+ gdbarch_frame_align_ftype *frame_align;
int extra_stack_alignment_needed;
gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
@@ -419,6 +420,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
@@ -775,6 +777,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
&& (gdbarch->frame_num_args == 0))
fprintf_unfiltered (log, "\n\tframe_num_args");
/* Skip verify of stack_align, has predicate */
+ /* Skip verify of frame_align, has predicate */
/* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
/* Skip verify of reg_struct_has_addr, has predicate */
/* Skip verify of save_dummy_frame_tos, has predicate */
@@ -827,6 +830,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
GDB_MULTI_ARCH);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
+ "gdbarch_dump: frame_align = 0x%08lx\n",
+ (long) current_gdbarch->frame_align);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
"gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
(long) current_gdbarch->in_function_epilogue_p);
if (GDB_MULTI_ARCH)
@@ -4510,6 +4517,32 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch,
}
int
+gdbarch_frame_align_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->frame_align != 0;
+}
+
+CORE_ADDR
+gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->frame_align == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_align invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
+ return gdbarch->frame_align (gdbarch, address);
+}
+
+void
+set_gdbarch_frame_align (struct gdbarch *gdbarch,
+ gdbarch_frame_align_ftype frame_align)
+{
+ gdbarch->frame_align = frame_align;
+}
+
+int
gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);