diff options
Diffstat (limited to 'gdb/config/v850')
-rw-r--r-- | gdb/config/v850/tm-v850.h | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/gdb/config/v850/tm-v850.h b/gdb/config/v850/tm-v850.h index eec0911..1bc61c4 100644 --- a/gdb/config/v850/tm-v850.h +++ b/gdb/config/v850/tm-v850.h @@ -85,16 +85,18 @@ extern void v850_frame_find_saved_regs PARAMS ((struct frame_info *fi, struct fr extern CORE_ADDR v850_frame_chain PARAMS ((struct frame_info *fi)); #define FRAME_CHAIN(fi) v850_frame_chain (fi) +#define FRAME_CHAIN_VALID(FP, FI) generic_frame_chain_valid (FP, FI) extern CORE_ADDR v850_find_callers_reg PARAMS ((struct frame_info *fi, int regnum)); -#define FRAME_SAVED_PC(fi) (v850_find_callers_reg (fi, RP_REGNUM)) +extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *)); +#define FRAME_SAVED_PC(FI) (v850_frame_saved_pc (FI)) #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ memcpy (VALBUF, REGBUF + REGISTER_BYTE (V0_REGNUM), TYPE_LENGTH (TYPE)) #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ - REGISTER_RAW_SIZE (V0_REGNUM))) + extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ + REGISTER_RAW_SIZE (V0_REGNUM)) #define STORE_RETURN_VALUE(TYPE, VALBUF) \ write_register_bytes(REGISTER_BYTE (V0_REGNUM), VALBUF, TYPE_LENGTH (TYPE)); @@ -108,23 +110,41 @@ extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc)); #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) #define FRAME_NUM_ARGS(val, fi) ((val) = -1) -extern struct frame_info *v850_pop_frame PARAMS ((struct frame_info *frame)); +extern void v850_pop_frame PARAMS ((struct frame_info *frame)); #define POP_FRAME v850_pop_frame (get_current_frame ()) -#define CALL_DUMMY { 0 } - -#define CALL_DUMMY_START_OFFSET (0) - +#if 0 +/* Use these defines if, for whatever reason, you want to use a + genuine call_dummy sequence (A sequence of machine instructions + that GDB will write into the target address space, usually on the + stack, for calling a function in the inferior): + + This sequence of words defines the instructions: + + jarl <offset24>, r31 + trap +*/ +#define CALL_DUMMY { 0x0000ff80, 0xffffffff } +#define CALL_DUMMY_LENGTH (8) +#define CALL_DUMMY_START_OFFSET (0) +#define CALL_DUMMY_BREAKPOINT_OFFSET (4) +#define CALL_DUMMY_LOCATION ON_STACK +#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) \ + v850_fix_call_dummy (DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP); + +#else /* These defines write NO instructions into the inferior process, + and are therefore preferred because they make target calls faster. */ +#define CALL_DUMMY {0} +#define CALL_DUMMY_START_OFFSET (0) #define CALL_DUMMY_BREAKPOINT_OFFSET (0) +#define CALL_DUMMY_LOCATION AT_ENTRY_POINT +#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) +#define CALL_DUMMY_ADDRESS() entry_point_address () +extern CORE_ADDR v850_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +#define PUSH_RETURN_ADDRESS(PC, SP) v850_push_return_address (PC, SP) +#endif -extern void v850_push_dummy_frame PARAMS ((void)); -#define PUSH_DUMMY_FRAME v850_push_dummy_frame () - -#define FIX_CALL_DUMMY(DUMMY1, START_SP, FUNADDR, NARGS, ARGS, VALUE_TYPE, USING_GCC) - -#define CALL_DUMMY_LOCATION AT_ENTRY_POINT - -#define STACK_ALIGN(x) ((x + 3) & ~3) +#define PUSH_DUMMY_FRAME generic_push_dummy_frame () extern CORE_ADDR v850_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp, @@ -135,14 +155,16 @@ v850_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp, #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) -#define CALL_DUMMY_ADDRESS() (entry_point_address ()) -extern int v850_pc_in_call_dummy PARAMS ((CORE_ADDR pc)); -#define PC_IN_CALL_DUMMY(PC, SP, FP) v850_pc_in_call_dummy (PC) +#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP) #define USE_STRUCT_CONVENTION(GCC_P, TYPE) \ (TYPE_NFIELDS (TYPE) > 1 || TYPE_LENGTH (TYPE) > 4) +/* override the default get_saved_register function with + one that takes account of generic CALL_DUMMY frames */ +#define GET_SAVED_REGISTER + /* Define this for Wingdb */ #define TARGET_V850 |