- DBREG_DRX ((&dbregs), regnum) = value;
-
- if (ptrace (PT_SETDBREGS, PIDGET (inferior_ptid),
- (PTRACE_TYPE_ARG3) &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);
-
- i386bsd_dr_set (regnum, 0);
-}
-
-unsigned long
-i386bsd_dr_get_status (void)
-{
- struct dbreg dbregs;
-
- /* FIXME: kettenis/2001-03-31: Calling perror_with_name if the
- ptrace call fails breaks debugging remote targets. The correct
- way to fix this is to add the hardware breakpoint and watchpoint
- stuff to the target vector. For now, just return zero if the
- ptrace call fails. */
- if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
- (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
-#if 0
- perror_with_name ("Couldn't read debug registers");
-#else
- return 0;
-#endif
-
- return DBREG_DRX ((&dbregs), 6);
-}
-
-#endif /* PT_GETDBREGS */
-\f
-
-/* Support for the user struct. */
-
-/* Return the address register REGNUM. BLOCKEND is the value of
- u.u_ar0, which should point to the registers. */
-
-CORE_ADDR
-register_u_addr (CORE_ADDR blockend, int regnum)
-{
- gdb_assert (regnum >= 0 && regnum < ARRAY_SIZE (i386bsd_r_reg_offset));
-
- return blockend + i386bsd_r_reg_offset[regnum];
-}
-
-#include <sys/param.h>
-#include <sys/user.h>
-
-/* Return the size of the user struct. */
-
-int
-kernel_u_size (void)
-{
- return (sizeof (struct user));
-}
-\f