+/* Return a `value' with the contents of (virtual or cooked) register
+ REGNUM as found in the specified FRAME. The register's type is
+ determined by register_type(). The value is not fetched. */
+
+struct value *
+value_of_register_lazy (struct frame_info *frame, int regnum)
+{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct value *reg_val;
+
+ gdb_assert (regnum < (gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch)));
+
+ /* We should have a valid (i.e. non-sentinel) frame. */
+ gdb_assert (frame_id_p (get_frame_id (frame)));
+
+ reg_val = allocate_value (register_type (gdbarch, regnum));
+ VALUE_LVAL (reg_val) = lval_register;
+ VALUE_REGNUM (reg_val) = regnum;
+ VALUE_FRAME_ID (reg_val) = get_frame_id (frame);
+ set_value_lazy (reg_val, 1);
+ return reg_val;
+}
+