+2001-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (init_extra_frame_info): Change to a function with
+ pedicate.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * blockframe.c (create_new_frame): Replace #ifdef
+ INIT_EXTRA_FRAME_INFO with run-time test of
+ INIT_EXTRA_FRAME_INFO_P.
+
2001-11-05 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (verify_gdbarch): Use a mem_file to accumulate all
find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
fi->signal_handler_caller = IN_SIGTRAMP (fi->pc, name);
-#ifdef INIT_EXTRA_FRAME_INFO
- INIT_EXTRA_FRAME_INFO (0, fi);
-#endif
+ if (INIT_EXTRA_FRAME_INFO_P ())
+ INIT_EXTRA_FRAME_INFO (0, fi);
return fi;
}
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_init_saved_regs == 0))
fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
- if ((GDB_MULTI_ARCH >= 2)
- && (gdbarch->init_extra_frame_info == 0))
- fprintf_unfiltered (log, "\n\tinit_extra_frame_info");
+ /* Skip verify of init_extra_frame_info, has predicate */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->skip_prologue == 0))
fprintf_unfiltered (log, "\n\tskip_prologue");
gdbarch->frame_init_saved_regs = frame_init_saved_regs;
}
+int
+gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->init_extra_frame_info != 0;
+}
+
void
gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
{
#endif
#endif
+#if defined (INIT_EXTRA_FRAME_INFO)
+/* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */
+#if !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (0)
+#endif
+
+extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P)
+#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO)
+#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0)
+#endif
+
typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info);
f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0
#
f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
-f:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
+F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
#
f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0