/* Machine-dependent hooks for the unix child process stratum. This
code is for the HP PA-RISC cpu.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
#include "defs.h"
#include "inferior.h"
+#include "target.h"
+#include <sys/ptrace.h>
+
+#ifdef FIVE_ARG_PTRACE
+
+/* Deal with HPUX 8.0 braindamage. */
+#define ptrace(a,b,c,d) ptrace(a,b,c,d,0)
+
+#endif
#ifndef PT_ATTACH
#define PT_ATTACH PTRACE_ATTACH
#endif
+
#ifndef PT_DETACH
#define PT_DETACH PTRACE_DETACH
#endif
/* This function simply calls ptrace with the given arguments.
It exists so that all calls to ptrace are isolated in this
machine-dependent file. */
-#ifdef WANT_NATIVE_TARGET
+
int
call_ptrace (request, pid, addr, data)
int request, pid;
{
return ptrace (request, pid, addr, data);
}
-#endif /* WANT_NATIVE_TARGET */
#ifdef DEBUG_PTRACE
/* For the rest of the file, use an extra level of indirection */
}
#ifdef ATTACH_DETACH
-/* Nonzero if we are debugging an attached process rather than
- an inferior. */
-extern int attach_flag;
/* Start debugging the process whose number is PID. */
int
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{
errno = 0;
- ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+ ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
*(int *) ®isters[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{
errno = 0;
- ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+ ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
*(int *) ®isters[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{