+/* Get a register value as a unsigned value directly from the system,
+ instead of going through the regcache.
+
+ This function is meant to be used when inferior_ptid is not
+ a thread/process known to GDB. */
+
+static ULONGEST
+ia64_hpux_get_register_from_save_state_t (int regnum, int reg_size)
+{
+ gdb_byte *buf = alloca (reg_size);
+ int offset = u_offsets[regnum];
+ int status;
+
+ /* The register is assumed to be available for fetching. */
+ gdb_assert (offset != -1);
+
+ status = ia64_hpux_read_register_from_save_state_t (offset, buf, reg_size);
+ if (status < 0)
+ {
+ /* This really should not happen. If it does, emit a warning
+ and pretend the register value is zero. Not exactly the best
+ error recovery mechanism, but better than nothing. We will
+ try to do better if we can demonstrate that this can happen
+ under normal circumstances. */
+ warning (_("Failed to read value of register number %d."), regnum);
+ return 0;
+ }
+
+ return extract_unsigned_integer (buf, reg_size, BFD_ENDIAN_BIG);
+}
+