aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-11-05 23:11:31 +0000
committerAndrew Cagney <cagney@redhat.com>2001-11-05 23:11:31 +0000
commit5fdff4261c7ed2a7c14c2e72cb6981e853af2803 (patch)
treeedddf127a9f330bf999f65b5d19c66c87f399cab
parent0a2a5e0f3c3ac5b6f635e33a4a804d5c1083f33b (diff)
downloadgdb-5fdff4261c7ed2a7c14c2e72cb6981e853af2803.zip
gdb-5fdff4261c7ed2a7c14c2e72cb6981e853af2803.tar.gz
gdb-5fdff4261c7ed2a7c14c2e72cb6981e853af2803.tar.bz2
Change INIT_EXTRA_FRAME_INFO() to a function with predicate.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/blockframe.c5
-rw-r--r--gdb/gdbarch.c10
-rw-r--r--gdb/gdbarch.h25
-rwxr-xr-xgdb/gdbarch.sh2
5 files changed, 44 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a764f40..d07aab8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
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
error messages. Print in a single batch.
* gdbarch.c: Re-generate.
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index c88649e..1c6ec2c 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -227,9 +227,8 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
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;
}
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index ce42082..9cbc87a 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -694,9 +694,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
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");
@@ -3615,6 +3613,12 @@ set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
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)
{
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 31746fc..1990969 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1441,6 +1441,31 @@ extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_
#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);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 623b03e..5e1f101 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -487,7 +487,7 @@ F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *re
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