summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-02-18 15:59:14 +0000
committerAndrew Cagney <cagney@redhat.com>2002-02-18 15:59:14 +0000
commit80879a9a35423abf4485a1d8df3641bcc194ff61 (patch)
tree4e03a533c3fab4a633760ac584bcee3f2a3394e5 /gdb
parent9fe8f5b3a0f95770ea2cda53a7e514eb981fea0f (diff)
downloadgdb-80879a9a35423abf4485a1d8df3641bcc194ff61.tar.gz
* gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2.
Default to func_frame_chain_valid. * gdbarch.h, gdbarch.c: Re-generate. * frame.h (FRAME_CHAIN_VALID): Delete definition.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/frame.h14
-rw-r--r--gdb/gdbarch.c5
-rw-r--r--gdb/gdbarch.h17
-rwxr-xr-xgdb/gdbarch.sh10
5 files changed, 31 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5bbf94c1203..ab9e7a349ae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2002-02-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2.
+ Default to func_frame_chain_valid.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * frame.h (FRAME_CHAIN_VALID): Delete definition.
+
2002-02-18 Elena Zannoni <ezannoni@redhat.com>
* ppc-linux-nat.c: Update copyright.
diff --git a/gdb/frame.h b/gdb/frame.h
index f4c51e07b42..b5f535a26d0 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -152,9 +152,6 @@ extern void frame_saved_regs_zalloc (struct frame_info *);
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
- If a particular target needs a different definition, then it can override
- the definition here by providing one in the tm file.
-
XXXX - both default and alternate frame_chain_valid functions are
deprecated. New code should use dummy frames and one of the
generic functions. */
@@ -166,17 +163,6 @@ extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *);
extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *);
extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
-#if !defined (FRAME_CHAIN_VALID)
-#if !defined (FRAME_CHAIN_VALID_ALTERNATE)
-#define FRAME_CHAIN_VALID(chain, thisframe) file_frame_chain_valid (chain, thisframe)
-#else
-/* Use the alternate method of avoiding running up off the end of the frame
- chain or following frames back into the startup code. See the comments
- in objfiles.h. */
-#define FRAME_CHAIN_VALID(chain, thisframe) func_frame_chain_valid (chain,thisframe)
-#endif /* FRAME_CHAIN_VALID_ALTERNATE */
-#endif /* FRAME_CHAIN_VALID */
-
/* The stack frame that the user has specified for commands to act on.
Note that one cannot assume this is the address of valid data. */
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 8467d414237..5aad461ed48 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -514,6 +514,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
current_gdbarch->frame_args_skip = -1;
current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
+ current_gdbarch->frame_chain_valid = func_frame_chain_valid;
current_gdbarch->extra_stack_alignment_needed = 1;
current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
current_gdbarch->addr_bits_remove = core_addr_identity;
@@ -742,9 +743,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->frame_chain == 0))
fprintf_unfiltered (log, "\n\tframe_chain");
- if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->frame_chain_valid == 0))
- fprintf_unfiltered (log, "\n\tframe_chain_valid");
+ /* Skip verify of frame_chain_valid, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->frame_saved_pc == 0))
fprintf_unfiltered (log, "\n\tframe_saved_pc");
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 2dba00f3ee1..81f5174aa8b 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1812,16 +1812,27 @@ extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chai
#endif
#endif
-/* See comments on DUMMY_FRAME for why this is required at level 1. */
+/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for
+ most targets. If FRAME_CHAIN_VALID returns zero it means that the
+ given frame is the outermost one and has no caller.
+
+ XXXX - both default and alternate frame_chain_valid functions are
+ deprecated. New code should use dummy frames and one of the generic
+ functions. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
+#define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe))
+#endif
typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid);
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
#error "Non multi-arch definition of FRAME_CHAIN_VALID"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID)
#define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
#endif
#endif
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 996b87668d3..310d3c4cd7c 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -547,8 +547,14 @@ f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR g
v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
-# See comments on DUMMY_FRAME for why this is required at level 1.
-f:1:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0
+# Define a default FRAME_CHAIN_VALID, in the form that is suitable for
+# most targets. If FRAME_CHAIN_VALID returns zero it means that the
+# given frame is the outermost one and has no caller.
+#
+# XXXX - both default and alternate frame_chain_valid functions are
+# deprecated. New code should use dummy frames and one of the generic
+# functions.
+f:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe:::func_frame_chain_valid::0
f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:0
f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:0