aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-15 06:27:18 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-15 06:27:18 +0000
commitd1e3cf49987161b72dd638ff94a5fc3e1f684484 (patch)
treefb3689f10eea0c4158d27e4296c4b96792b61a8d /gdb
parentf23d52e0a54905bc88c1a5ea25168227356d6f37 (diff)
downloadgdb-d1e3cf49987161b72dd638ff94a5fc3e1f684484.zip
gdb-d1e3cf49987161b72dd638ff94a5fc3e1f684484.tar.gz
gdb-d1e3cf49987161b72dd638ff94a5fc3e1f684484.tar.bz2
Convert SAVE_DUMMY_FRAME_TOS to multi-arch.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/gdbarch.c32
-rw-r--r--gdb/gdbarch.h29
-rwxr-xr-xgdb/gdbarch.sh1
-rw-r--r--gdb/valops.c5
5 files changed, 72 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5e655b1..27bc318 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+Mon May 15 15:31:30 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (hand_function_call): Replace #ifdef
+ SAVE_DUMMY_FRAME_TOS with if SAVE_DUMMY_FRAME_TOS_P.
+
+ * gdbarch.sh (SAVE_DUMMY_FRAME_TOS): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
Mon May 15 16:05:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
* ax.h (make_cleanup_free_agent_expr): Add declaration.
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 557633d..bcad7b9 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -219,6 +219,7 @@ struct gdbarch
gdbarch_frame_num_args_ftype *frame_num_args;
gdbarch_stack_align_ftype *stack_align;
gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
+ gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
};
@@ -329,6 +330,7 @@ struct gdbarch startup_gdbarch = {
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
@@ -634,6 +636,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
/* Skip verify of stack_align, has predicate */
/* Skip verify of reg_struct_has_addr, has predicate */
+ /* Skip verify of save_dummy_frame_tos, has predicate */
}
@@ -1176,6 +1179,12 @@ gdbarch_dump (void)
(long) current_gdbarch->reg_struct_has_addr
/*REG_STRUCT_HAS_ADDR ()*/);
#endif
+#ifdef SAVE_DUMMY_FRAME_TOS
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
+ (long) current_gdbarch->save_dummy_frame_tos
+ /*SAVE_DUMMY_FRAME_TOS ()*/);
+#endif
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: GDB_MULTI_ARCH = %d\n",
GDB_MULTI_ARCH);
@@ -2788,6 +2797,29 @@ set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
gdbarch->reg_struct_has_addr = reg_struct_has_addr;
}
+int
+gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->save_dummy_frame_tos != 0;
+}
+
+void
+gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ if (gdbarch->save_dummy_frame_tos == 0)
+ internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
+ gdbarch->save_dummy_frame_tos (sp);
+}
+
+void
+set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
+ gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
+{
+ gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
+}
+
/* Keep a registrary of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index dde7c51..7121a22 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1062,6 +1062,35 @@ extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_re
#endif
#endif
+#if defined (SAVE_DUMMY_FRAME_TOS)
+/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
+#define SAVE_DUMMY_FRAME_TOS_P() (1)
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (GDB_MULTI_ARCH == 0) && !defined (SAVE_DUMMY_FRAME_TOS_P)
+#define SAVE_DUMMY_FRAME_TOS_P() (0)
+#endif
+
+extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > 1) || !defined (SAVE_DUMMY_FRAME_TOS_P)
+#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (GDB_MULTI_ARCH == 0) && !defined (SAVE_DUMMY_FRAME_TOS)
+#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error ("SAVE_DUMMY_FRAME_TOS"), 0)
+#endif
+
+typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
+extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
+extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > 1) || !defined (SAVE_DUMMY_FRAME_TOS)
+#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
+#endif
+#endif
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 499cf33..cbc7cf3 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -326,6 +326,7 @@ f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0
#
F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
+F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0
EOF
grep -v '^#'
}
diff --git a/gdb/valops.c b/gdb/valops.c
index 0632ede..710c2be 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1678,9 +1678,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */
write_sp (sp);
-#ifdef SAVE_DUMMY_FRAME_TOS
- SAVE_DUMMY_FRAME_TOS (sp);
-#endif
+ if (SAVE_DUMMY_FRAME_TOS_P ())
+ SAVE_DUMMY_FRAME_TOS (sp);
{
char retbuf[REGISTER_BYTES];