- gdb_assert (priv->registers);
- value = priv->registers[reg];
- if (value && value->defined)
- return frame_unwind_got_bytes (this_frame, reg, value->value);
+ gdbarch = priv->regcache->arch ();
+ gdb_byte *buf = (gdb_byte *) alloca (register_size (gdbarch, reg));
+ enum register_status status = priv->regcache->cooked_read (reg, buf);
+
+ if (status == REG_VALID)
+ return frame_unwind_got_bytes (this_frame, reg, buf);