* frame.c (frame_saved_regs_pop): Assert POP_FRAME_P.
* gdbarch.sh (POP_FRAME): Change to function with predicate.
Suppress actual parameters when `-'.
* gdbarch.h, gdbarch.c: Regenerate.
+2003-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (frame_saved_regs_pop): Assert POP_FRAME_P.
+ * gdbarch.sh (POP_FRAME): Change to function with predicate.
+ Suppress actual parameters when `-'.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
2003-01-19 Andrew Cagney <ac131313@redhat.com>
* d10v-tdep.c (d10v_frame_saved_pc, d10v_frame_chain): Restore
frame_saved_regs_pop (struct frame_info *fi, void **cache,
struct regcache *regcache)
{
+ gdb_assert (POP_FRAME_P ());
POP_FRAME;
}
&& (gdbarch->push_dummy_frame == 0))
fprintf_unfiltered (log, "\n\tpush_dummy_frame");
/* Skip verify of push_return_address, has predicate */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->pop_frame == 0))
- fprintf_unfiltered (log, "\n\tpop_frame");
+ /* Skip verify of pop_frame, has predicate */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->store_struct_return == 0))
fprintf_unfiltered (log, "\n\tstore_struct_return");
(long) current_gdbarch->pointer_to_address
/*POINTER_TO_ADDRESS ()*/);
#endif
+#ifdef POP_FRAME_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "POP_FRAME_P()",
+ XSTRING (POP_FRAME_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: POP_FRAME_P() = %d\n",
+ POP_FRAME_P ());
+#endif
#ifdef POP_FRAME
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
gdbarch->push_return_address = push_return_address;
}
+int
+gdbarch_pop_frame_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->pop_frame != 0;
+}
+
void
gdbarch_pop_frame (struct gdbarch *gdbarch)
{
#endif
#endif
+#if defined (POP_FRAME)
+/* Legacy for systems yet to multi-arch POP_FRAME */
+#if !defined (POP_FRAME_P)
+#define POP_FRAME_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME_P)
+#define POP_FRAME_P() (0)
+#endif
+
+extern int gdbarch_pop_frame_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME_P)
+#error "Non multi-arch definition of POP_FRAME"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME_P)
+#define POP_FRAME_P() (gdbarch_pop_frame_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME)
+#define POP_FRAME (internal_error (__FILE__, __LINE__, "POP_FRAME"), 0)
+#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
+#endif
+
typedef void (gdbarch_pop_frame_ftype) (void);
extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
-f:2:POP_FRAME:void:pop_frame:void:-:::0
+F:2:POP_FRAME:void:pop_frame:void:-:::0
#
f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
#
printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n"
if [ "x${fallbackdefault}" = "x0" ]
then
- printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
+ if [ "x${actual}" = "x-" ]
+ then
+ printf "#define ${macro} (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
+ printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+ else
+ printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
+ fi
else
# FIXME: Should be passing current_gdbarch through!
echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \