aboutsummaryrefslogtreecommitdiff
path: root/gdb/d10v-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/d10v-tdep.c')
-rw-r--r--gdb/d10v-tdep.c112
1 files changed, 111 insertions, 1 deletions
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 566af71..861533f 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -924,7 +924,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
{
char ptr[2];
/* arg will go onto stack */
- store_address (ptr, val & 0xffff, 2);
+ store_address (ptr, 2, val & 0xffff);
si = push_stack_item (si, ptr, 2);
}
}
@@ -1322,12 +1322,122 @@ display_trace (low, high)
}
+static gdbarch_init_ftype d10v_gdbarch_init;
+static struct gdbarch *
+d10v_gdbarch_init (info, arches)
+ struct gdbarch_info info;
+ struct gdbarch_list *arches;
+{
+ static LONGEST d10v_call_dummy_words[] = { 0 };
+ struct gdbarch *gdbarch;
+ int d10v_num_regs = 37;
+
+ /* there is only one d10v architecture */
+ if (arches != NULL)
+ return arches->gdbarch;
+ gdbarch = gdbarch_alloc (&info, NULL);
+
+ set_gdbarch_read_pc (gdbarch, d10v_read_pc);
+ set_gdbarch_write_pc (gdbarch, d10v_write_pc);
+ set_gdbarch_read_fp (gdbarch, d10v_read_fp);
+ set_gdbarch_write_fp (gdbarch, d10v_write_fp);
+ set_gdbarch_read_sp (gdbarch, d10v_read_sp);
+ set_gdbarch_write_sp (gdbarch, d10v_write_sp);
+
+ set_gdbarch_num_regs (gdbarch, d10v_num_regs);
+ set_gdbarch_sp_regnum (gdbarch, 15);
+ set_gdbarch_fp_regnum (gdbarch, 11);
+ set_gdbarch_pc_regnum (gdbarch, 18);
+ set_gdbarch_register_name (gdbarch, d10v_register_name);
+ set_gdbarch_register_size (gdbarch, 2);
+ set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16);
+ set_gdbarch_register_byte (gdbarch, d10v_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, d10v_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_register_virtual_size (gdbarch, d10v_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_register_virtual_type (gdbarch, d10v_register_virtual_type);
+
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ 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_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
+ set_gdbarch_call_dummy_words (gdbarch, d10v_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (d10v_call_dummy_words));
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+
+ set_gdbarch_register_convertible (gdbarch, d10v_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch, d10v_register_convert_to_virtual);
+ set_gdbarch_register_convert_to_raw (gdbarch, d10v_register_convert_to_raw);
+
+ set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
+ set_gdbarch_push_arguments (gdbarch, d10v_push_arguments);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_push_return_address (gdbarch, d10v_push_return_address);
+
+ set_gdbarch_d10v_make_daddr (gdbarch, d10v_make_daddr);
+ set_gdbarch_d10v_make_iaddr (gdbarch, d10v_make_iaddr);
+ set_gdbarch_d10v_daddr_p (gdbarch, d10v_daddr_p);
+ set_gdbarch_d10v_iaddr_p (gdbarch, d10v_iaddr_p);
+ set_gdbarch_d10v_convert_daddr_to_raw (gdbarch, d10v_convert_daddr_to_raw);
+ set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch, d10v_convert_iaddr_to_raw);
+
+ set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return);
+ set_gdbarch_store_return_value (gdbarch, d10v_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);
+ set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, d10v_frame_init_saved_regs);
+ set_gdbarch_init_extra_frame_info (gdbarch, d10v_init_extra_frame_info);
+
+ set_gdbarch_pop_frame (gdbarch, d10v_pop_frame);
+
+ set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue);
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_decr_pc_after_break (gdbarch, 4);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_breakpoint_from_pc (gdbarch, d10v_breakpoint_from_pc);
+
+ set_gdbarch_remote_translate_xfer_address (gdbarch, remote_d10v_translate_xfer_address);
+
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+ set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
+ set_gdbarch_frame_chain (gdbarch, d10v_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, d10v_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, d10v_frame_saved_pc);
+ set_gdbarch_frame_args_address (gdbarch, d10v_frame_args_address);
+ set_gdbarch_frame_locals_address (gdbarch, d10v_frame_locals_address);
+ set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call);
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+
+ return gdbarch;
+}
+
+
extern void (*target_resume_hook) PARAMS ((void));
extern void (*target_wait_loop_hook) PARAMS ((void));
void
_initialize_d10v_tdep ()
{
+ register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
+
tm_print_insn = print_insn_d10v;
target_resume_hook = d10v_eva_prepare_to_trace;