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.
This commit is contained in:
Andrew Cagney 2003-01-19 23:27:28 +00:00
parent b7261c70f1
commit dedc2a2b65
5 changed files with 59 additions and 5 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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;
}

View File

@ -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)
{

View File

@ -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);

View File

@ -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}))" \