X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdbserver%2Flinux-mips-low.cc;h=d5be60ede06cfdc7e3c399ab457185c6abf25896;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=5696af6fae26aa71ec34eebfe9857216fb7aeb2a;hpb=9db9aa232ac37e4dca92733678748adc1bfc7ef0;p=deliverable%2Fbinutils-gdb.git diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc index 5696af6fae..d5be60ede0 100644 --- a/gdbserver/linux-mips-low.cc +++ b/gdbserver/linux-mips-low.cc @@ -60,6 +60,28 @@ protected: int low_remove_point (raw_bkpt_type type, CORE_ADDR addr, int size, raw_breakpoint *bp) override; + + bool low_stopped_by_watchpoint () override; + + CORE_ADDR low_stopped_data_address () override; + + void low_collect_ptrace_register (regcache *regcache, int regno, + char *buf) override; + + void low_supply_ptrace_register (regcache *regcache, int regno, + const char *buf) override; + + arch_process_info *low_new_process () override; + + void low_delete_process (arch_process_info *info) override; + + void low_new_thread (lwp_info *) override; + + void low_delete_thread (arch_lwp_info *) override; + + void low_new_fork (process_info *parent, process_info *child) override; + + void low_prepare_to_resume (lwp_info *lwp) override; }; /* The singleton target ops object. */ @@ -367,32 +389,32 @@ update_watch_registers_callback (thread_info *thread) linux_stop_lwp (lwp); } -/* This is the implementation of linux_target_ops method - new_process. */ +/* This is the implementation of linux target ops method + low_new_process. */ -static struct arch_process_info * -mips_linux_new_process (void) +arch_process_info * +mips_target::low_new_process () { struct arch_process_info *info = XCNEW (struct arch_process_info); return info; } -/* This is the implementation of linux_target_ops method - delete_process. */ +/* This is the implementation of linux target ops method + low_delete_process. */ -static void -mips_linux_delete_process (struct arch_process_info *info) +void +mips_target::low_delete_process (arch_process_info *info) { xfree (info); } -/* This is the implementation of linux_target_ops method new_thread. +/* This is the implementation of linux target ops method low_new_thread. Mark the watch registers as changed, so the threads' copies will be updated. */ -static void -mips_linux_new_thread (struct lwp_info *lwp) +void +mips_target::low_new_thread (lwp_info *lwp) { struct arch_lwp_info *info = XCNEW (struct arch_lwp_info); @@ -403,8 +425,8 @@ mips_linux_new_thread (struct lwp_info *lwp) /* Function to call when a thread is being deleted. */ -static void -mips_linux_delete_thread (struct arch_lwp_info *arch_lwp) +void +mips_target::low_delete_thread (arch_lwp_info *arch_lwp) { xfree (arch_lwp); } @@ -432,9 +454,9 @@ mips_add_watchpoint (struct arch_process_info *priv, CORE_ADDR addr, int len, /* Hook to call when a new fork is attached. */ -static void -mips_linux_new_fork (struct process_info *parent, - struct process_info *child) +void +mips_target::low_new_fork (process_info *parent, + process_info *child) { struct arch_process_info *parent_private; struct arch_process_info *child_private; @@ -471,12 +493,12 @@ mips_linux_new_fork (struct process_info *parent, child_private->watch_mirror = parent_private->watch_mirror; } -/* This is the implementation of linux_target_ops method - prepare_to_resume. If the watch regs have changed, update the +/* This is the implementation of linux target ops method + low_prepare_to_resume. If the watch regs have changed, update the thread's copies. */ -static void -mips_linux_prepare_to_resume (struct lwp_info *lwp) +void +mips_target::low_prepare_to_resume (lwp_info *lwp) { ptid_t ptid = ptid_of (get_lwp_thread (lwp)); struct process_info *proc = find_process_pid (ptid.pid ()); @@ -608,12 +630,12 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr, return 0; } -/* This is the implementation of linux_target_ops method - stopped_by_watchpoint. The watchhi R and W bits indicate +/* This is the implementation of linux target ops method + low_stopped_by_watchpoint. The watchhi R and W bits indicate the watch register triggered. */ -static int -mips_stopped_by_watchpoint (void) +bool +mips_target::low_stopped_by_watchpoint () { struct process_info *proc = current_process (); struct arch_process_info *priv = proc->priv->arch_private; @@ -632,16 +654,16 @@ mips_stopped_by_watchpoint (void) for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++) if (mips_linux_watch_get_watchhi (&priv->watch_readback, n) & (R_MASK | W_MASK)) - return 1; + return true; - return 0; + return false; } -/* This is the implementation of linux_target_ops method - stopped_data_address. */ +/* This is the implementation of linux target ops method + low_stopped_data_address. */ -static CORE_ADDR -mips_stopped_data_address (void) +CORE_ADDR +mips_target::low_stopped_data_address () { struct process_info *proc = current_process (); struct arch_process_info *priv = proc->priv->arch_private; @@ -887,9 +909,9 @@ mips_store_fpregset (struct regcache *regcache, const void *buf) /* Take care of 32-bit registers with 64-bit ptrace, POKEUSER side. */ -static void -mips_collect_ptrace_register (struct regcache *regcache, - int regno, char *buf) +void +mips_target::low_collect_ptrace_register (regcache *regcache, int regno, + char *buf) { int use_64bit = sizeof (PTRACE_XFER_TYPE) == 8; @@ -906,9 +928,9 @@ mips_collect_ptrace_register (struct regcache *regcache, /* Take care of 32-bit registers with 64-bit ptrace, PEEKUSER side. */ -static void -mips_supply_ptrace_register (struct regcache *regcache, - int regno, const char *buf) +void +mips_target::low_supply_ptrace_register (regcache *regcache, int regno, + const char *buf) { int use_64bit = sizeof (PTRACE_XFER_TYPE) == 8; @@ -975,20 +997,6 @@ mips_target::get_regs_info () return &myregs_info; } -struct linux_target_ops the_low_target = { - mips_stopped_by_watchpoint, - mips_stopped_data_address, - mips_collect_ptrace_register, - mips_supply_ptrace_register, - NULL, /* siginfo_fixup */ - mips_linux_new_process, - mips_linux_delete_process, - mips_linux_new_thread, - mips_linux_delete_thread, - mips_linux_new_fork, - mips_linux_prepare_to_resume -}; - /* The linux target ops object. */ linux_process_target *the_linux_target = &the_mips_target;