diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-05-09 02:04:26 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-05-09 02:04:26 +0000 |
commit | ad8fe2ce8460b4d8409df0b73fd87e9a5d5895a7 (patch) | |
tree | 1659bec680a47251258efbbe02baf831019f0a6d /gdb/mn10300-tdep.c | |
parent | 631ec795c9246b5862348ff41c297ccb978205c2 (diff) | |
download | gdb-ad8fe2ce8460b4d8409df0b73fd87e9a5d5895a7.zip gdb-ad8fe2ce8460b4d8409df0b73fd87e9a5d5895a7.tar.gz gdb-ad8fe2ce8460b4d8409df0b73fd87e9a5d5895a7.tar.bz2 |
Use gdbarch for most target parameters for the MN10300, rather
than the tm-*.h file.
* config/mn10300/tm-mn10300.h (MAX_REGISTER_VIRTUAL_SIZE,
REGISTER_BYTES, FP_REGNUM, BREAKPOINT_FROM_PC,
FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK, INNER_THAN,
SAVED_PC_AFTER_CALL, INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS,
FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC,
EXTRACT_RETURN_VALUE, EXTRACT_STRUCT_VALUE_ADDRESS,
STORE_RETURN_VALUE, STORE_STRUCT_RETURN, SKIP_PROLOGUE,
FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS,
FRAME_NUM_ARGS, POP_FRAME, USE_GENERIC_DUMMY_FRAMES, CALL_DUMMY,
CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET,
CALL_DUMMY_LOCATION, FIX_CALL_DUMMY, CALL_DUMMY_ADDRESS,
TARGET_READ_FP, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME,
SAVE_DUMMY_FRAME_TOS, PUSH_ARGUMENTS, PC_IN_CALL_DUMMY,
REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER):
Delete definitions. We register gdbarch methods for these now.
(struct frame_info, struct type, struct value): Delete forward
declarations of these types; they're no longer necessary, since we
don't have function declarations here any more.
* mn10300-tdep.c: #include "arch-utils.h", to get declarations for
some default gdbarch methods.
(mn10300_store_struct_return): Return void, as expected by
gdbarch.
(mn10300_init_extra_frame_info): Take initial `fromleaf' argument,
as expected by gdbarch.
(mn10300_frame_init_saved_regs): Provide dummy definition for
this, as required by gdbarch.
(mn10300_gdbarch_init): Add mn10300_call_dummy_words, as expected
by gdbarch. Register gdbarch methods or values for all the stuff
removed from tm-10300.h, listed above.
Diffstat (limited to 'gdb/mn10300-tdep.c')
-rw-r--r-- | gdb/mn10300-tdep.c | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 506c27c..a3e513a 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -30,6 +30,7 @@ #include "gdbcore.h" #include "symfile.h" #include "regcache.h" +#include "arch-utils.h" extern void _initialize_mn10300_tdep (void); static CORE_ADDR mn10300_analyze_prologue (struct frame_info *fi, @@ -727,12 +728,11 @@ mn10300_push_return_address (CORE_ADDR pc, CORE_ADDR sp) Store the structure value return address for an inferior function call. */ -CORE_ADDR +void mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { /* The structure return address is passed as the first argument. */ write_register (0, addr); - return sp; } /* Function: frame_saved_pc @@ -777,7 +777,7 @@ mn10300_frame_saved_pc (struct frame_info *fi) pointer just prior to calling the target function (see run_stack_dummy). */ void -mn10300_init_extra_frame_info (struct frame_info *fi) +mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi) { if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); @@ -792,6 +792,14 @@ mn10300_init_extra_frame_info (struct frame_info *fi) mn10300_analyze_prologue (fi, 0); } + +/* This function's job is handled by init_extra_frame_info. */ +void +mn10300_frame_init_saved_regs (struct frame_info *frame) +{ +} + + /* Function: mn10300_virtual_frame_pointer Return the register that the function uses for a frame pointer, plus any necessary offset to be applied to the register before @@ -944,6 +952,7 @@ static struct gdbarch * mn10300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { + static LONGEST mn10300_call_dummy_words[] = { 0 }; struct gdbarch *gdbarch; struct gdbarch_tdep *tdep = NULL; int am33_mode; @@ -1001,6 +1010,44 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_num_regs (gdbarch, num_regs); set_gdbarch_do_registers_info (gdbarch, mn10300_do_registers_info); + set_gdbarch_fp_regnum (gdbarch, 31); + set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_register_bytes (gdbarch, + num_regs * gdbarch_register_size (gdbarch)); + set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc); + set_gdbarch_function_start_offset (gdbarch, 0); + set_gdbarch_decr_pc_after_break (gdbarch, 0); + set_gdbarch_inner_than (gdbarch, core_addr_lessthan); + set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); + set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call); + set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); + set_gdbarch_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); + set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain); + set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc); + set_gdbarch_extract_return_value (gdbarch, mn10300_extract_return_value); + set_gdbarch_extract_struct_value_address + (gdbarch, mn10300_extract_struct_value_address); + set_gdbarch_store_return_value (gdbarch, mn10300_store_return_value); + set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return); + set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); + set_gdbarch_frame_args_skip (gdbarch, 0); + set_gdbarch_frame_args_address (gdbarch, default_frame_address); + set_gdbarch_frame_locals_address (gdbarch, default_frame_address); + set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + /* That's right, we're using the stack pointer as our frame pointer. */ + set_gdbarch_read_fp (gdbarch, generic_target_read_sp); + set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); + set_gdbarch_call_dummy_address (gdbarch, entry_point_address); + set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words); + 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_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); + set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); + set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention); + tdep->am33_mode = am33_mode; return gdbarch; |