aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-linux-nat.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2015-08-25 11:38:29 +0100
committerYao Qi <yao.qi@linaro.org>2015-08-25 11:39:13 +0100
commit5e35436ed12617494d2a2d190e0faca5613a2e9f (patch)
tree72ec89a970b9c8c66baeb2c9754a61c4a59ba2bb /gdb/aarch64-linux-nat.c
parent75e1f0f7a0992835415e9bb924ec21a9aac6d5a1 (diff)
downloadgdb-5e35436ed12617494d2a2d190e0faca5613a2e9f.zip
gdb-5e35436ed12617494d2a2d190e0faca5613a2e9f.tar.gz
gdb-5e35436ed12617494d2a2d190e0faca5613a2e9f.tar.bz2
Move debug_reg_change_callback and aarch64_notify_debug_reg_change to nat/aarch64-linux-hw-point.c
gdb: 2015-08-25 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (struct arch64_dr_update_callback_param): Move it to nat/aarch64-linux-hw-point.c. (debug_reg_change_callback): Likewise. (aarch64_notify_debug_reg_change): :Likewise. * nat/aarch64-linux-hw-point.c: Include nat/linux-nat.h. (aarch64_dr_update_callback_param): New. (debug_reg_change_callback): New function. (aarch64_notify_debug_reg_change): Likewise. * nat/aarch64-linux-hw-point.h (aarch64_notify_debug_reg_change): Remove the declaration. gdb/gdbserver: 2015-08-25 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (struct arch64_dr_update_callback_param): Remove. (debug_reg_change_callback): Remove. (aarch64_notify_debug_reg_change): Remove.
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r--gdb/aarch64-linux-nat.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 354d8f8..9bae9ce 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -147,91 +147,6 @@ aarch64_get_debug_reg_state (pid_t pid)
return &aarch64_process_info_get (pid)->state;
}
-struct aarch64_dr_update_callback_param
-{
- int is_watchpoint;
- unsigned int idx;
-};
-
-/* Callback for iterate_over_lwps. Records the
- information about the change of one hardware breakpoint/watchpoint
- setting for the thread LWP.
- The information is passed in via PTR.
- N.B. The actual updating of hardware debug registers is not
- carried out until the moment the thread is resumed. */
-
-static int
-debug_reg_change_callback (struct lwp_info *lwp, void *ptr)
-{
- struct aarch64_dr_update_callback_param *param_p
- = (struct aarch64_dr_update_callback_param *) ptr;
- int pid = ptid_get_pid (ptid_of_lwp (lwp));
- int idx = param_p->idx;
- int is_watchpoint = param_p->is_watchpoint;
- struct arch_lwp_info *info = lwp->arch_private;
- dr_changed_t *dr_changed_ptr;
- dr_changed_t dr_changed;
-
- if (info == NULL)
- info = lwp->arch_private = XCNEW (struct arch_lwp_info);
-
- if (show_debug_regs)
- {
- debug_printf ("debug_reg_change_callback: \n\tOn entry:\n");
- debug_printf ("\tpid%d, dr_changed_bp=0x%s, "
- "dr_changed_wp=0x%s\n", pid,
- phex (info->dr_changed_bp, 8),
- phex (info->dr_changed_wp, 8));
- }
-
- dr_changed_ptr = is_watchpoint ? &info->dr_changed_wp
- : &info->dr_changed_bp;
- dr_changed = *dr_changed_ptr;
-
- gdb_assert (idx >= 0
- && (idx <= (is_watchpoint ? aarch64_num_wp_regs
- : aarch64_num_bp_regs)));
-
- /* The actual update is done later just before resuming the lwp,
- we just mark that one register pair needs updating. */
- DR_MARK_N_CHANGED (dr_changed, idx);
- *dr_changed_ptr = dr_changed;
-
- /* If the lwp isn't stopped, force it to momentarily pause, so
- we can update its debug registers. */
- if (!lwp->stopped)
- linux_stop_lwp (lwp);
-
- if (show_debug_regs)
- {
- debug_printf ("\tOn exit:\n\tpid%d, dr_changed_bp=0x%s, "
- "dr_changed_wp=0x%s\n", pid,
- phex (info->dr_changed_bp, 8),
- phex (info->dr_changed_wp, 8));
- }
-
- /* Continue the iteration. */
- return 0;
-}
-
-/* Notify each thread that their IDXth breakpoint/watchpoint register
- pair needs to be updated. The message will be recorded in each
- thread's arch-specific data area, the actual updating will be done
- when the thread is resumed. */
-
-void
-aarch64_notify_debug_reg_change (const struct aarch64_debug_reg_state *state,
- int is_watchpoint, unsigned int idx)
-{
- struct aarch64_dr_update_callback_param param;
- ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (current_lwp_ptid ()));
-
- param.is_watchpoint = is_watchpoint;
- param.idx = idx;
-
- iterate_over_lwps (pid_ptid, debug_reg_change_callback, (void *) &param);
-}
-
/* Fill GDB's register array with the general-purpose register values
from the current thread. */