+2002-07-04 Grace Sainsbury <graces@redhat.com>
+
+ * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2.
+ (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG,RETVAL_REGNUM): Move to
+ mcore-tdep.
+ (REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER)
+ (TARGET_VIRTUAL_FRAME_POINTER, BELIEVE_PCC_PROMOTION): Remove.
+ * mcore-tdep.c (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG)
+ (RETVAL_REGNUM): Move macros from tm-mcore.h
+ (mcore_reg_struct_has_addr): New function.
+ (mcore_gdbarch_init): Added initializations for the macros removed
+ from tm-mcore.h.
+
2002-07-04 Mark Kettenis <kettenis@gnu.org>
* osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's
#include "symtab.h" /* For namespace_enum. */
#include "symfile.h" /* For entry_point_address(). */
-#define GDB_MULTI_ARCH 0
+#define GDB_MULTI_ARCH 2
#if !GDB_MULTI_ARCH
/* All registers are 32 bits */
#define SP_REGNUM 0
#define FP_REGNUM (SP_REGNUM)
#endif
-#define PR_REGNUM 15
-#define FIRST_ARGREG 2
-#define LAST_ARGREG 7
-#define RETVAL_REGNUM 2
/* Offset from address of function to start of its code.
Zero on most machines. */
#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
#define SAVED_PC_AFTER_CALL(FRAME) read_register (PR_REGNUM)
-#endif
struct frame_info;
struct type;
struct value;
+#endif
#if !GDB_MULTI_ARCH
extern void mcore_init_extra_frame_info (struct frame_info *fi);
#if !GDB_MULTI_ARCH
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
-#endif
/* MCore will never pass a sturcture by reference. It will always be split
between registers and stack. */
/* For PE, gcc will tell us what th real type of
arguments are when it promotes arguments. */
#define BELIEVE_PCC_PROMOTION 1
+#endif
#define MCORE_REG_SIZE 4
#define MCORE_NUM_REGS 65
+/* Some useful register numbers. */
+#define PR_REGNUM 15
+#define FIRST_ARGREG 2
+#define LAST_ARGREG 7
+#define RETVAL_REGNUM 2
+
/* Additional info that we use for managing frames */
struct frame_extra_info
}
+static int
+mcore_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ return 0;
+}
+
+
/* Helper function for several routines below. This funtion simply
sets up a fake, aka dummy, frame (not a _call_ dummy frame) that
we can analyze with mcore_analyze_prologue. */
set_gdbarch_pc_regnum (gdbarch, 64);
set_gdbarch_sp_regnum (gdbarch, 0);
set_gdbarch_fp_regnum (gdbarch, 0);
+ set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
/* Call Dummies: */
set_gdbarch_push_return_address (gdbarch, mcore_push_return_address);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_arguments (gdbarch, mcore_push_arguments);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
/* Frames: */
set_gdbarch_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info);
set_gdbarch_frame_chain (gdbarch, mcore_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs);
set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc);
set_gdbarch_store_return_value (gdbarch, mcore_store_return_value);
set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_pop_frame (gdbarch, mcore_pop_frame);
+ set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer);
/* Misc.: */
/* Stack grows down. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_use_struct_convention (gdbarch, mcore_use_struct_convention);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+ /* MCore will never pass a sturcture by reference. It will always be split
+ between registers and stack. */
+ set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr);
return gdbarch;
}