{
int i;
/* Round starting address down to longword boundary. */
- CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
+ CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
/* Round ending address up; get number of longwords that makes. */
- int count = ((((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
- / sizeof (PTRACE_XFER_TYPE));
- int alloc = count * sizeof (PTRACE_XFER_TYPE);
- PTRACE_XFER_TYPE *buffer;
+ int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
+ / sizeof (PTRACE_TYPE_RET));
+ int alloc = count * sizeof (PTRACE_TYPE_RET);
+ PTRACE_TYPE_RET *buffer;
struct cleanup *old_chain = NULL;
#ifdef PT_IO
/* Allocate buffer of that many longwords. */
if (len < GDB_MAX_ALLOCA)
{
- buffer = (PTRACE_XFER_TYPE *) alloca (alloc);
+ buffer = (PTRACE_TYPE_RET *) alloca (alloc);
}
else
{
- buffer = (PTRACE_XFER_TYPE *) xmalloc (alloc);
+ buffer = (PTRACE_TYPE_RET *) xmalloc (alloc);
old_chain = make_cleanup (xfree, buffer);
}
{
/* Fill start and end extra bytes of buffer with existing memory
data. */
- if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
+ if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET))
{
/* Need part of initial word -- fetch it. */
buffer[0] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
buffer[count - 1] =
ptrace (PT_READ_I, PIDGET (inferior_ptid),
((PTRACE_TYPE_ARG3)
- (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))), 0);
+ (addr + (count - 1) * sizeof (PTRACE_TYPE_RET))), 0);
}
/* Copy data to be written over corresponding part of buffer. */
- memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
+ memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
myaddr, len);
/* Write the entire buffer. */
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
{
errno = 0;
ptrace (PT_WRITE_D, PIDGET (inferior_ptid),
else
{
/* Read all the longwords. */
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
{
errno = 0;
buffer[i] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
/* Copy appropriate bytes out of the buffer. */
memcpy (myaddr,
- (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
+ (char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
len);
}