- /* Describe the register's location. A reg-frame maps all registers
- onto the corresponding hardware register. */
- *optimized = 0;
- *lvalp = lval_register;
- *addrp = register_offset_hack (current_gdbarch, regnum);
- *realnum = regnum;
-
- /* If needed, find and return the value of the register. */
- if (bufferp != NULL)
- {
- /* Return the actual value. */
- /* Use the regcache_cooked_read() method so that it, on the fly,
- constructs either a raw or pseudo register from the raw
- register cache. */
- regcache_cooked_read (cache->regcache, regnum, bufferp);
- }
+ struct value *value;
+
+ /* Return the actual value. */
+ value = allocate_value (register_type (gdbarch, regnum));
+ VALUE_LVAL (value) = lval_register;
+ VALUE_REGNUM (value) = regnum;
+ VALUE_FRAME_ID (value) = get_frame_id (this_frame);
+
+ /* Use the regcache_cooked_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_cooked_read (cache->regcache, regnum, value_contents_raw (value));
+
+ return value;