-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010, 2012 Free Software Foundation, Inc.
This file is part of GDB.
buf = alloca (len * sizeof (gdb_byte));
status = ia64_hpux_read_register_from_save_state_t (offset, buf, len);
if (status < 0)
- warning (_("Failed to read register value for %s.\n"),
+ warning (_("Failed to read register value for %s."),
gdbarch_register_name (gdbarch, regnum));
regcache_raw_supply (regcache, regnum, buf);
status = ia64_hpux_write_register_to_saved_state_t (offset, buf, len);
if (status < 0)
- error (_("failed to write register value for %s.\n"),
+ error (_("failed to write register value for %s."),
gdbarch_register_name (gdbarch, regnum));
}
return len;
}
+/* Handle the transfer of TARGET_OBJECT_HPUX_UREGS objects on ia64-hpux.
+ ANNEX is currently ignored.
+
+ The current implementation does not support write transfers (because
+ we do not currently do not need these transfers), and will raise
+ a failed assertion if WRITEBUF is not NULL. */
+
+static LONGEST
+ia64_hpux_xfer_uregs (struct target_ops *ops, const char *annex,
+ gdb_byte *readbuf, const gdb_byte *writebuf,
+ ULONGEST offset, LONGEST len)
+{
+ int status;
+
+ gdb_assert (writebuf == NULL);
+
+ status = ia64_hpux_read_register_from_save_state_t (offset, readbuf, len);
+ if (status < 0)
+ return -1;
+ return len;
+}
+
+/* Handle the transfer of TARGET_OBJECT_HPUX_SOLIB_GOT objects on ia64-hpux.
+
+ The current implementation does not support write transfers (because
+ we do not currently do not need these transfers), and will raise
+ a failed assertion if WRITEBUF is not NULL. */
+
+static LONGEST
+ia64_hpux_xfer_solib_got (struct target_ops *ops, const char *annex,
+ gdb_byte *readbuf, const gdb_byte *writebuf,
+ ULONGEST offset, LONGEST len)
+{
+ CORE_ADDR fun_addr;
+ /* The linkage pointer. We use a uint64_t to make sure that the size
+ of the object we are returning is always 64 bits long, as explained
+ in the description of the TARGET_OBJECT_HPUX_SOLIB_GOT object.
+ This is probably paranoia, but we do not use a CORE_ADDR because
+ it could conceivably be larger than uint64_t. */
+ uint64_t got;
+
+ gdb_assert (writebuf == NULL);
+
+ if (offset > sizeof (got))
+ return 0;
+
+ fun_addr = string_to_core_addr (annex);
+ got = ia64_hpux_get_solib_linkage_addr (fun_addr);
+
+ if (len > sizeof (got) - offset)
+ len = sizeof (got) - offset;
+ memcpy (readbuf, &got + offset, len);
+
+ return len;
+}
+
/* The "to_xfer_partial" target_ops routine for ia64-hpux. */
static LONGEST
if (object == TARGET_OBJECT_MEMORY)
val = ia64_hpux_xfer_memory (ops, annex, readbuf, writebuf, offset, len);
+ else if (object == TARGET_OBJECT_HPUX_UREGS)
+ val = ia64_hpux_xfer_uregs (ops, annex, readbuf, writebuf, offset, len);
+ else if (object == TARGET_OBJECT_HPUX_SOLIB_GOT)
+ val = ia64_hpux_xfer_solib_got (ops, annex, readbuf, writebuf, offset,
+ len);
else
val = super_xfer_partial (ops, object, annex, readbuf, writebuf, offset,
len);