2003-03-31 Andrew Cagney <cagney@redhat.com>

* gdbarch.sh (FIX_CALL_DUMMY): Change to function with predicate.
	* gdbarch.h, gdbarch.c: Regenerate.
	* inferior.h (FIX_CALL_DUMMY): Delete macro.
	* valops.c (hand_function_call): Only call FIX_CALL_DUMMY when
	available.
	* frame.h (generic_fix_call_dummy): Delete declaration.
	* dummy-frame.h: Update comment.
	* dummy-frame.c (generic_fix_call_dummy): Delete function.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
	fix_call_dummy.
	* sh-tdep.c (sh_gdbarch_init): Ditto.
	* s390-tdep.c (s390_gdbarch_init): Ditto.
	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
	* m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
	* ia64-tdep.c (ia64_gdbarch_init): Ditto.
	* i386-tdep.c (i386_gdbarch_init): Ditto.
	* h8300-tdep.c (h8300_gdbarch_init): Ditto.
	* frv-tdep.c (frv_gdbarch_init): Ditto.
	* d10v-tdep.c (d10v_gdbarch_init): Ditto.
	* cris-tdep.c (cris_gdbarch_init): Ditto.
	* avr-tdep.c (avr_gdbarch_init): Ditto.
	* arm-tdep.c (arm_gdbarch_init): Ditto.
This commit is contained in:
Andrew Cagney 2003-03-31 23:52:38 +00:00
parent 018d1b488c
commit e8ab51f713
23 changed files with 77 additions and 44 deletions

View file

@ -1,3 +1,29 @@
2003-03-31 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (FIX_CALL_DUMMY): Change to function with predicate.
* gdbarch.h, gdbarch.c: Regenerate.
* inferior.h (FIX_CALL_DUMMY): Delete macro.
* valops.c (hand_function_call): Only call FIX_CALL_DUMMY when
available.
* frame.h (generic_fix_call_dummy): Delete declaration.
* dummy-frame.h: Update comment.
* dummy-frame.c (generic_fix_call_dummy): Delete function.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
fix_call_dummy.
* sh-tdep.c (sh_gdbarch_init): Ditto.
* s390-tdep.c (s390_gdbarch_init): Ditto.
* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
* mcore-tdep.c (mcore_gdbarch_init): Ditto.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
* ia64-tdep.c (ia64_gdbarch_init): Ditto.
* i386-tdep.c (i386_gdbarch_init): Ditto.
* h8300-tdep.c (h8300_gdbarch_init): Ditto.
* frv-tdep.c (frv_gdbarch_init): Ditto.
* d10v-tdep.c (d10v_gdbarch_init): Ditto.
* cris-tdep.c (cris_gdbarch_init): Ditto.
* avr-tdep.c (avr_gdbarch_init): Ditto.
* arm-tdep.c (arm_gdbarch_init): Ditto.
2003-03-31 J. Brobecker <brobecker@gnat.com>
* config/pa/tm-hppa64.h (FRAME_ARGS_ADDRESS): Delete macro, not useful.

View file

@ -2938,8 +2938,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
/* Frame handling. */

View file

@ -1173,7 +1173,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
/* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */

View file

@ -4271,9 +4271,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_words (gdbarch, 0);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
/* No stack adjustment needed when peforming an inferior function call. */
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
/* No register requires conversion from raw format to virtual format. */

View file

@ -1676,7 +1676,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call);

View file

@ -294,17 +294,6 @@ generic_pop_dummy_frame (void)
discard_innermost_dummy (&dummy_frame_stack);
}
/* Function: fix_call_dummy
Stub function. Generic dummy frames typically do not need to fix
the frame being created */
void
generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
struct value **args, struct type *type, int gcc_p)
{
return;
}
/* Given a call-dummy dummy-frame, return the registers. Here the
register value is taken from the local copy of the register buffer. */

View file

@ -41,8 +41,8 @@ struct frame_id;
zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
to define PUSH_RETURN_ADDRESS, because no call instruction will be
being executed by the target. Also DEPRECATED_FRAME_CHAIN_VALID as
generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as
generic_fix_call_dummy. */
generic_{file,func}_frame_chain_valid and do not set
FIX_CALL_DUMMY. */
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */

View file

@ -544,10 +544,6 @@ extern int generic_pc_in_call_dummy (CORE_ADDR pc,
extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args,
struct type *type, int gcc_p);
void generic_unwind_get_saved_register (char *raw_buffer,
int *optimizedp,
CORE_ADDR *addrp,

View file

@ -1110,7 +1110,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);

View file

@ -691,9 +691,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of call_dummy_words, invalid_p == 0 */
/* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
/* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->fix_call_dummy == 0))
fprintf_unfiltered (log, "\n\tfix_call_dummy");
/* Skip verify of fix_call_dummy, has predicate */
/* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
/* Skip verify of deprecated_get_saved_register, has predicate */
@ -1635,6 +1633,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->extract_struct_value_address
/*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
#ifdef FIX_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"FIX_CALL_DUMMY_P()",
XSTRING (FIX_CALL_DUMMY_P ()));
fprintf_unfiltered (file,
"gdbarch_dump: FIX_CALL_DUMMY_P() = %d\n",
FIX_CALL_DUMMY_P ());
#endif
#ifdef FIX_CALL_DUMMY
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@ -3893,6 +3900,13 @@ set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch,
gdbarch->deprecated_call_dummy_stack_adjust = deprecated_call_dummy_stack_adjust;
}
int
gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
return gdbarch->fix_call_dummy != 0;
}
void
gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
{

View file

@ -1309,6 +1309,31 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba
#endif
#endif
#if defined (FIX_CALL_DUMMY)
/* Legacy for systems yet to multi-arch FIX_CALL_DUMMY */
#if !defined (FIX_CALL_DUMMY_P)
#define FIX_CALL_DUMMY_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY_P)
#define FIX_CALL_DUMMY_P() (0)
#endif
extern int gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY_P)
#error "Non multi-arch definition of FIX_CALL_DUMMY"
#endif
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY_P)
#define FIX_CALL_DUMMY_P() (gdbarch_fix_call_dummy_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY)
#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0)
#endif
typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);

View file

@ -534,7 +534,7 @@ F:1:DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CO
v::CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
v::SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0
f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
F::FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
#

View file

@ -1162,7 +1162,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);

View file

@ -1565,7 +1565,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_call_dummy_words (gdbarch, NULL);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_register_convertible (gdbarch, i386_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch,

View file

@ -2240,7 +2240,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);

View file

@ -439,10 +439,6 @@ extern int attach_flag;
#define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0)
#endif
#if !defined FIX_CALL_DUMMY
#define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0)
#endif
#if !defined STORE_STRUCT_RETURN
#define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0)
#endif

View file

@ -1389,7 +1389,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_sizeof_call_dummy_words (gdbarch,
sizeof (m68hc11_call_dummy_words));
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments);
set_gdbarch_deprecated_push_return_address (gdbarch, m68hc11_push_return_address);

View file

@ -1121,7 +1121,6 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
set_gdbarch_function_start_offset (gdbarch, 0);

View file

@ -1191,7 +1191,6 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_sizeof_call_dummy_words (gdbarch,
sizeof (mn10300_call_dummy_words));
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments);

View file

@ -1868,7 +1868,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_push_return_address (gdbarch, s390_push_return_address);
set_gdbarch_sizeof_call_dummy_words (gdbarch,
sizeof (s390_call_dummy_words));

View file

@ -4659,7 +4659,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words));
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_push_return_address (gdbarch, sh_push_return_address);

View file

@ -1424,8 +1424,12 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
value_type, using_gcc);
#else
FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
value_type, using_gcc);
if (FIX_CALL_DUMMY_P ())
{
/* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, value_type,
using_gcc);
}
real_pc = start_sp;
#endif

View file

@ -1099,7 +1099,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
set_gdbarch_char_signed (gdbarch, 0);