#include "x86-xstate.h"
#include "nat/linux-btrace.h"
#include "nat/linux-nat.h"
+#include "nat/x86-linux.h"
/* Per-thread arch-specific data we want to keep. */
static int
update_debug_registers_callback (struct lwp_info *lwp, void *arg)
{
- if (lwp->arch_private == NULL)
- lwp->arch_private = XCNEW (struct arch_lwp_info);
-
/* The actual update is done later just before resuming the lwp, we
just mark that the registers need updating. */
- lwp->arch_private->debug_registers_changed = 1;
+ lwp_set_debug_registers_changed (lwp, 1);
/* If the lwp isn't stopped, force it to momentarily pause, so we
can update its debug registers. */
ptid_t ptid = ptid_of_lwp (lwp);
int clear_status = 0;
- /* NULL means this is the main thread still going through the shell,
- or, no watchpoint has been set yet. In that case, there's
- nothing to do. */
- if (lwp->arch_private == NULL)
- return;
-
- if (lwp->arch_private->debug_registers_changed)
+ if (lwp_debug_registers_changed (lwp))
{
struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (ptid));
if (state->dr_control_mirror != 0)
x86_linux_dr_set (ptid, DR_CONTROL, state->dr_control_mirror);
- lwp->arch_private->debug_registers_changed = 0;
+ lwp_set_debug_registers_changed (lwp, 0);
}
if (clear_status
static void
x86_linux_new_thread (struct lwp_info *lp)
{
- struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);
-
- info->debug_registers_changed = 1;
-
- lp->arch_private = info;
+ lwp_set_debug_registers_changed (lp, 1);
}
\f