Пример #1
0
static LONGEST
child_xfer_partial (struct target_ops *ops, enum target_object object,
		    const char *annex, gdb_byte *readbuf,
		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
{
  switch (object)
    {
    case TARGET_OBJECT_MEMORY:
      if (readbuf)
	return child_xfer_memory (offset, readbuf, len, 0/*write*/,
				  NULL, ops);
      if (writebuf)
	return child_xfer_memory (offset, (void *) writebuf, len, 1/*write*/,
				  NULL, ops);
      return -1;

    case TARGET_OBJECT_UNWIND_TABLE:
#ifndef NATIVE_XFER_UNWIND_TABLE
#define NATIVE_XFER_UNWIND_TABLE(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
#endif
      return NATIVE_XFER_UNWIND_TABLE (ops, object, annex, readbuf, writebuf,
				       offset, len);

    case TARGET_OBJECT_AUXV:
#ifndef NATIVE_XFER_AUXV
#define NATIVE_XFER_AUXV(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
#endif
      return NATIVE_XFER_AUXV (ops, object, annex, readbuf, writebuf,
			       offset, len);

    default:
      return -1;
    }
}
Пример #2
0
/* Write memory to the inferior process.  This should generally be
   called through write_inferior_memory, which handles breakpoint shadowing.
   Write LEN bytes from the buffer at MYADDR to MEMADDR.
   Returns 0 on success and errno on failure.  */
static int
win32_write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
			     int len)
{
  return child_xfer_memory (memaddr, (char *) myaddr, len, 1, 0) != len;
}
Пример #3
0
/* Read memory from the inferior process.  This should generally be
   called through read_inferior_memory, which handles breakpoint shadowing.
   Read LEN bytes at MEMADDR into a buffer at MYADDR.  */
static int
win32_read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
  return child_xfer_memory (memaddr, (char *) myaddr, len, 0, 0) != len;
}