+2015-03-24 Gary Benson <gbenson@redhat.com>
+
+ * x86-linux-nat.c (x86_linux_update_debug_registers):
+ New function, factored out from...
+ (x86_linux_prepare_to_resume): ...this.
+
2015-03-24 Gary Benson <gbenson@redhat.com>
* x86-linux-nat.c (x86_linux_dr_get): Update comments.
+2015-03-24 Gary Benson <gbenson@redhat.com>
+
+ * linux-x86-low.c (x86_linux_update_debug_registers):
+ New function, factored out from...
+ (x86_linux_prepare_to_resume): ...this.
+
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_dr_get): Update comments.
return &proc->priv->arch_private->debug_reg_state;
}
-/* Called prior to resuming a thread. Updates the thread's debug
- registers if the values in our local mirror have been changed. */
+/* Update the thread's debug registers if the values in our local
+ mirror have been changed. */
static void
-x86_linux_prepare_to_resume (struct lwp_info *lwp)
+x86_linux_update_debug_registers (struct lwp_info *lwp)
{
ptid_t ptid = ptid_of_lwp (lwp);
int clear_status = 0;
+ gdb_assert (lwp_is_stopped (lwp));
+
if (lwp_debug_registers_changed (lwp))
{
struct x86_debug_reg_state *state
|| lwp_stop_reason (lwp) == TARGET_STOPPED_BY_WATCHPOINT)
x86_linux_dr_set (ptid, DR_STATUS, 0);
}
+
+/* Called prior to resuming a thread. */
+
+static void
+x86_linux_prepare_to_resume (struct lwp_info *lwp)
+{
+ x86_linux_update_debug_registers (lwp);
+}
\f
/* When GDBSERVER is built as a 64-bit application on linux, the
PTRACE_GETSIGINFO data is always presented in 64-bit layout. Since
iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
}
-/* Called prior to resuming a thread. Updates the thread's debug
- registers if the values in our local mirror have been changed. */
+/* Update the thread's debug registers if the values in our local
+ mirror have been changed. */
static void
-x86_linux_prepare_to_resume (struct lwp_info *lwp)
+x86_linux_update_debug_registers (struct lwp_info *lwp)
{
ptid_t ptid = ptid_of_lwp (lwp);
int clear_status = 0;
+ gdb_assert (lwp_is_stopped (lwp));
+
if (lwp_debug_registers_changed (lwp))
{
struct x86_debug_reg_state *state
x86_linux_dr_set (ptid, DR_STATUS, 0);
}
+/* Called prior to resuming a thread. */
+
+static void
+x86_linux_prepare_to_resume (struct lwp_info *lwp)
+{
+ x86_linux_update_debug_registers (lwp);
+}
+
/* Called when a new thread is detected. */
static void