#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
PTRACE_ARG3_TYPE addr;
int data;
{
- return ptrace (request, pid, addr, data);
+ return ptrace (request, pid, addr, data, 0);
}
-#ifdef DEBUG_PTRACE
-/* For the rest of the file, use an extra level of indirection */
-/* This lets us breakpoint usefully on call_ptrace. */
+/* Use an extra level of indirection for ptrace calls.
+ This lets us breakpoint usefully on call_ptrace. It also
+ allows us to pass an extra argument to ptrace without
+ using an ANSI-C specific macro. */
+
#define ptrace call_ptrace
-#endif
void
kill_inferior ()
static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }};
/* read the value of the u area from the hp-ux kernel */
-void _initialize_kernel_u_addr ()
+void
+_initialize_kernel_u_addr ()
{
struct user u;
nlist ("/hp-ux", &nl);
child_resume (pid, step, signal)
int pid;
int step;
- int signal;
+ enum target_signal signal;
{
errno = 0;
+ if (pid == -1)
+ pid = inferior_pid;
+
/* An address of (PTRACE_ARG3_TYPE) 1 tells ptrace to continue from where
it was. (If GDB wanted it to start some other way, we have already
written a new PC value to the child.) */
/* Copy data to be written over corresponding part of buffer */
- bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
+ memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
/* Write the entire buffer. */
}
/* Copy appropriate bytes out of the buffer. */
- bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
+ memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
}
return len;
}