X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Flinux-m32r-low.c;h=39eb929a190b1349ba92f8e1009a43ded9a839cf;hb=476350ba4800f1144b125f6511a5e25b223cc90b;hp=e20852366fefba574c78fa0779e5104e2b478225;hpb=ecd75fc8eed3bde86036141228074a20e55dcfc9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c index e20852366f..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-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -53,26 +53,18 @@ m32r_cannot_fetch_register (int regno) return (regno >= m32r_num_regs); } -static CORE_ADDR -m32r_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} +static const unsigned short m32r_breakpoint = 0x10f1; +#define m32r_breakpoint_len 2 -static void -m32r_set_pc (struct regcache *regcache, 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 (regcache, "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) { @@ -94,6 +86,14 @@ 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, @@ -118,13 +118,34 @@ struct linux_target_ops the_low_target = { m32r_cannot_fetch_register, m32r_cannot_store_register, NULL, /* fetch_register */ - m32r_get_pc, - m32r_set_pc, - (const unsigned char *) &m32r_breakpoint, - m32r_breakpoint_len, + 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