+ reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
+
+ /* Use the regcache_cooked_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ cache->prev_regcache->cooked_read (regnum,
+ value_contents_writeable (reg_val));
+ return reg_val;
+}
+
+/* Assuming that THIS_FRAME is a dummy, return its ID. That ID is
+ determined by examining the NEXT frame's unwound registers using
+ the method dummy_id(). As a side effect, THIS dummy frame's
+ dummy cache is located and saved in THIS_PROLOGUE_CACHE. */
+
+static void
+dummy_frame_this_id (struct frame_info *this_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
+{
+ /* The dummy-frame sniffer always fills in the cache. */
+ struct dummy_frame_cache *cache
+ = (struct dummy_frame_cache *) *this_prologue_cache;
+
+ gdb_assert (cache != NULL);
+ (*this_id) = cache->this_id;
+}
+
+const struct frame_unwind dummy_frame_unwind =
+{
+ DUMMY_FRAME,
+ default_frame_unwind_stop_reason,
+ dummy_frame_this_id,
+ dummy_frame_prev_register,
+ NULL,
+ dummy_frame_sniffer,
+};
+
+/* See dummy-frame.h. */
+
+struct frame_id
+default_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ CORE_ADDR sp, pc;
+
+ sp = get_frame_sp (this_frame);
+ pc = get_frame_pc (this_frame);
+ return frame_id_build (sp, pc);
+}