From: Grace Sainsbury Date: Thu, 4 Jul 2002 16:45:53 +0000 (+0000) Subject: * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efdc1108e76027a59e9333cacc977d14ecc1d7ad;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 96e274fafb1..5dd98a77caa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2002-07-04 Grace Sainsbury + + * 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 * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h index c47052ab2d9..fba6a145771 100644 --- a/gdb/config/mcore/tm-mcore.h +++ b/gdb/config/mcore/tm-mcore.h @@ -23,7 +23,7 @@ #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 */ @@ -60,10 +60,6 @@ extern char *mcore_register_names[]; #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. */ @@ -81,11 +77,11 @@ extern const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR *pcptr, #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); @@ -153,7 +149,6 @@ extern CORE_ADDR mcore_push_arguments (int, struct value **, CORE_ADDR, #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. */ @@ -175,3 +170,4 @@ extern void mcore_virtual_frame_pointer (CORE_ADDR, int *, LONGEST *); /* For PE, gcc will tell us what th real type of arguments are when it promotes arguments. */ #define BELIEVE_PCC_PROMOTION 1 +#endif diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index ec2be104bca..f17f8e4b25d 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -82,6 +82,12 @@ int mcore_debug = 0; #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 @@ -264,6 +270,13 @@ mcore_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) } +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. */ @@ -1085,6 +1098,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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: */ @@ -1108,12 +1122,13 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); @@ -1128,11 +1143,17 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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; }