return value;
}
+/* Set debug register REGNUM to VALUE in only the one LWP of PTID. */
+
static void
amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
{
perror_with_name (_("Couldn't write debug register"));
}
+/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST. */
+
static void
amd64_linux_dr_set_control (unsigned long control)
{
amd64_linux_dr_set (ptid, DR_CONTROL, control);
}
+/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */
+
static void
amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
}
+/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */
+
static void
amd64_linux_dr_reset_addr (int regnum)
{
amd64_linux_dr_set_addr (regnum, 0);
}
+/* Get DR_STATUS from only the one LWP of INFERIOR_PTID. */
+
static unsigned long
amd64_linux_dr_get_status (void)
{
return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
}
+/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST. */
+
+static void
+amd64_linux_dr_unset_status (unsigned long mask)
+{
+ struct lwp_info *lp;
+ ptid_t ptid;
+
+ ALL_LWPS (lp, ptid)
+ {
+ unsigned long value;
+
+ value = amd64_linux_dr_get (ptid, DR_STATUS);
+ value &= ~mask;
+ amd64_linux_dr_set (ptid, DR_STATUS, value);
+ }
+}
+
+
static void
amd64_linux_new_thread (ptid_t ptid)
{
ps_get_thread_area (const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
- if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ if (gdbarch_ptr_bit (target_gdbarch) == 32)
{
/* The full structure is found in <asm-i386/ldt.h>. The second
integer is the LDT's base_address and that is used to locate
i386_dr_low.set_addr = amd64_linux_dr_set_addr;
i386_dr_low.reset_addr = amd64_linux_dr_reset_addr;
i386_dr_low.get_status = amd64_linux_dr_get_status;
+ i386_dr_low.unset_status = amd64_linux_dr_unset_status;
i386_set_debug_register_length (8);
/* Override the GNU/Linux inferior startup hook. */