X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Flinux-m32r-low.c;h=39eb929a190b1349ba92f8e1009a43ded9a839cf;hb=476350ba4800f1144b125f6511a5e25b223cc90b;hp=b50012a4762a35787c4743567746d3e620fec4a6;hpb=0fb0cc7590113e9b459dfcc48dc71c9d419d9580;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c index b50012a476..39eb929a19 100644 --- a/gdb/gdbserver/linux-m32r-low.c +++ b/gdb/gdbserver/linux-m32r-low.c @@ -1,5 +1,5 @@ /* GNU/Linux/m32r specific low level interface, for the remote server for GDB. - Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -25,6 +25,7 @@ /* Defined in auto-generated file reg-m32r.c. */ void init_registers_m32r (void); +extern const struct target_desc *tdesc_m32r; #define m32r_num_regs 25 @@ -52,24 +53,18 @@ m32r_cannot_fetch_register (int regno) return (regno >= m32r_num_regs); } -static CORE_ADDR -m32r_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - return pc; -} +static const unsigned short m32r_breakpoint = 0x10f1; +#define m32r_breakpoint_len 2 -static void -m32r_set_pc (CORE_ADDR pc) +/* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */ + +static const gdb_byte * +m32r_sw_breakpoint_from_kind (int kind, int *size) { - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); + *size = m32r_breakpoint_len; + return (const gdb_byte *) &m32r_breakpoint; } -static const unsigned short m32r_breakpoint = 0x10f1; -#define m32r_breakpoint_len 2 - static int m32r_breakpoint_at (CORE_ADDR where) { @@ -85,17 +80,76 @@ m32r_breakpoint_at (CORE_ADDR where) return 0; } +static void +m32r_arch_setup (void) +{ + current_process ()->tdesc = tdesc_m32r; +} + +/* Support for hardware single step. */ + +static int +m32r_supports_hardware_single_step (void) +{ + return 1; +} + +static struct usrregs_info m32r_usrregs_info = + { + m32r_num_regs, + m32r_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &m32r_usrregs_info, + }; + +static const struct regs_info * +m32r_regs_info (void) +{ + return ®s_info; +} + struct linux_target_ops the_low_target = { - init_registers_m32r, - m32r_num_regs, - m32r_regmap, + m32r_arch_setup, + m32r_regs_info, m32r_cannot_fetch_register, m32r_cannot_store_register, - m32r_get_pc, - m32r_set_pc, - (const unsigned char *) &m32r_breakpoint, - m32r_breakpoint_len, + NULL, /* fetch_register */ + linux_get_pc_32bit, + linux_set_pc_32bit, + NULL, /* breakpoint_from_pc */ + m32r_sw_breakpoint_from_kind, NULL, 0, m32r_breakpoint_at, + NULL, /* supports_z_point_type */ + NULL, /* insert_point */ + NULL, /* remove_point */ + NULL, /* stopped_by_watchpoint */ + NULL, /* stopped_data_address */ + NULL, /* collect_ptrace_register */ + NULL, /* supply_ptrace_register */ + NULL, /* siginfo_fixup */ + NULL, /* new_process */ + NULL, /* new_thread */ + NULL, /* new_fork */ + NULL, /* prepare_to_resume */ + NULL, /* process_qsupported */ + NULL, /* supports_tracepoints */ + NULL, /* get_thread_area */ + NULL, /* install_fast_tracepoint_jump_pad */ + NULL, /* emit_ops */ + NULL, /* get_min_fast_tracepoint_insn_len */ + NULL, /* supports_range_stepping */ + NULL, /* breakpoint_kind_from_current_state */ + m32r_supports_hardware_single_step, }; + +void +initialize_low_arch (void) +{ + init_registers_m32r (); +}