aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-19 23:27:28 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-19 23:27:28 +0000
commitdedc2a2b6559e402f90c322d37953d1875381b76 (patch)
tree743b5859a05fcbeeb90398d2951c84b71a67c692 /gdb
parentb7261c70f17360b2abbadbc0bbed3caabd1b23f6 (diff)
downloadgdb-dedc2a2b6559e402f90c322d37953d1875381b76.zip
gdb-dedc2a2b6559e402f90c322d37953d1875381b76.tar.gz
gdb-dedc2a2b6559e402f90c322d37953d1875381b76.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/frame.c1
-rw-r--r--gdb/gdbarch.c20
-rw-r--r--gdb/gdbarch.h26
-rwxr-xr-xgdb/gdbarch.sh10
5 files changed, 59 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8ae914e..fd024cc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
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
code handling dummy frames.
diff --git a/gdb/frame.c b/gdb/frame.c
index 9fb5e9b..b00eebc 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -731,6 +731,7 @@ static void
frame_saved_regs_pop (struct frame_info *fi, void **cache,
struct regcache *regcache)
{
+ gdb_assert (POP_FRAME_P ());
POP_FRAME;
}
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 069e566..bd19793 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -728,9 +728,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
&& (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");
@@ -1761,6 +1759,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(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 */
@@ -4178,6 +4185,13 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
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)
{
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 336f6ca..303477c 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1577,6 +1577,32 @@ extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_pu
#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);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9efadfe..fd9ddd5 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -538,7 +538,7 @@ f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::gen
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
#
@@ -907,7 +907,13 @@ do
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}))" \