-\f
-
-/* Support for debug registers. */
-
-#ifdef HAVE_PT_GETDBREGS
-
-/* Not all versions of FreeBSD/i386 that support the debug registers
- have this macro. */
-#ifndef DBREG_DRX
-#define DBREG_DRX(d, x) ((&d->dr0)[x])
-#endif
-
-static void
-i386bsd_dr_set (int regnum, unsigned int value)
-{
- struct dbreg dbregs;
-
- if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &dbregs, 0) == -1)
- perror_with_name ("Couldn't get debug registers");
-
- /* For some mysterious reason, some of the reserved bits in the
- debug control register get set. Mask these off, otherwise the
- ptrace call below will fail. */
- DBREG_DRX ((&dbregs), 7) &= ~(0x0000fc00);
-
- DBREG_DRX ((&dbregs), regnum) = value;
-
- if (ptrace (PT_SETDBREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &dbregs, 0) == -1)
- perror_with_name ("Couldn't write debug registers");
-}
-
-void
-i386bsd_dr_set_control (unsigned long control)
-{
- i386bsd_dr_set (7, control);
-}
-
-void
-i386bsd_dr_set_addr (int regnum, CORE_ADDR addr)
-{
- gdb_assert (regnum >= 0 && regnum <= 4);
-
- i386bsd_dr_set (regnum, addr);
-}
-
-void
-i386bsd_dr_reset_addr (int regnum)
-{
- gdb_assert (regnum >= 0 && regnum <= 4);