aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-04-21 04:17:18 +0000
committerAndrew Cagney <cagney@redhat.com>2000-04-21 04:17:18 +0000
commit2ada493ad19d2c56b79df05931f7c82710259000 (patch)
tree80c8c32b690dc195bb691cb7c9f32fee53c51b52 /gdb/gdbarch.c
parent2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8 (diff)
downloadgdb-2ada493ad19d2c56b79df05931f7c82710259000.zip
gdb-2ada493ad19d2c56b79df05931f7c82710259000.tar.gz
gdb-2ada493ad19d2c56b79df05931f7c82710259000.tar.bz2
* valops.c (hand_function_call): Replace #ifdef STACK_ALIGN with
run-time test for STACK_ALIGN_P. * gdbarch.sh: Add support for function and variable predicates. (STACK_ALIGN): Add. Implement with predicate - STACK_ALIGN_P. * gdbarch.h, gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1db4ce9..06eccad 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -213,6 +213,7 @@ struct gdbarch
gdbarch_frame_locals_address_ftype *frame_locals_address;
gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
gdbarch_frame_num_args_ftype *frame_num_args;
+ gdbarch_stack_align_ftype *stack_align;
};
@@ -317,6 +318,7 @@ struct gdbarch startup_gdbarch = {
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
@@ -620,6 +622,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_num_args == 0))
internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
+ /* Skip verify of stack_align, has predicate */
}
@@ -955,6 +958,10 @@ gdbarch_dump (void)
"gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
(long) current_gdbarch->frame_num_args
/*FRAME_NUM_ARGS ()*/);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
+ (long) current_gdbarch->stack_align
+ /*STACK_ALIGN ()*/);
}
struct gdbarch_tdep *
@@ -2487,6 +2494,29 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
gdbarch->frame_num_args = frame_num_args;
}
+int
+gdbarch_stack_align_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->stack_align != 0;
+}
+
+CORE_ADDR
+gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ if (gdbarch->stack_align == 0)
+ internal_error ("gdbarch: gdbarch_stack_align invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
+ return gdbarch->stack_align (sp);
+}
+
+void
+set_gdbarch_stack_align (struct gdbarch *gdbarch,
+ gdbarch_stack_align_ftype stack_align)
+{
+ gdbarch->stack_align = stack_align;
+}
+
/* Keep a registrary of per-architecture data-pointers required by GDB
modules. */