+m68hc11_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
+{
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (next_frame, this_prologue_cache);
+ CORE_ADDR base;
+ CORE_ADDR func;
+ struct frame_id id;
+
+ /* The FUNC is easy. */
+ func = frame_func_unwind (next_frame);
+
+ /* Hopefully the prologue analysis either correctly determined the
+ frame's base (which is the SP from the previous frame), or set
+ that base to "NULL". */
+ base = info->prev_sp;
+ if (base == 0)
+ return;
+
+ id = frame_id_build (base, func);
+#if 0
+ /* Check that we're not going round in circles with the same frame
+ ID (but avoid applying the test to sentinel frames which do go
+ round in circles). Can't use frame_id_eq() as that doesn't yet
+ compare the frame's PC value. */
+ if (frame_relative_level (next_frame) >= 0
+ && get_frame_type (next_frame) != DUMMY_FRAME
+ && frame_id_eq (get_frame_id (next_frame), id))
+ return;
+#endif
+ (*this_id) = id;
+}
+
+static void
+m68hc11_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (next_frame, this_prologue_cache);
+
+ trad_frame_prev_register (next_frame, info->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, bufferp);
+
+ if (regnum == HARD_PC_REGNUM)
+ {
+ /* Take into account the 68HC12 specific call (PC + page). */
+ if (info->return_kind == RETURN_RTC
+ && *addrp >= 0x08000 && *addrp < 0x0c000
+ && USE_PAGE_REGISTER)
+ {
+ int page_optimized;
+
+ CORE_ADDR page;
+
+ trad_frame_prev_register (next_frame, info->saved_regs,
+ HARD_PAGE_REGNUM, &page_optimized,
+ 0, &page, 0, 0);
+ *addrp -= 0x08000;
+ *addrp += ((page & 0x0ff) << 14);
+ *addrp += 0x1000000;
+ }
+ }
+}
+
+static const struct frame_unwind m68hc11_frame_unwind = {
+ NORMAL_FRAME,
+ m68hc11_frame_this_id,
+ m68hc11_frame_prev_register
+};
+
+const struct frame_unwind *
+m68hc11_frame_sniffer (struct frame_info *next_frame)
+{
+ return &m68hc11_frame_unwind;
+}
+
+static CORE_ADDR
+m68hc11_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (next_frame, this_cache);
+
+ return info->base;
+}
+
+static CORE_ADDR
+m68hc11_frame_args_address (struct frame_info *next_frame, void **this_cache)