if (cache->base == 0)
return;
+ /* See the end of i386_push_dummy_call. */
(*this_id) = frame_id_build (cache->base + 8, cache->pc);
}
struct i386_frame_cache *cache =
i386_sigtramp_frame_cache (next_frame, this_cache);
+ /* See the end of i386_push_dummy_call. */
(*this_id) = frame_id_build (cache->base + 8, frame_pc_unwind (next_frame));
}
i386_frame_base_address
};
-static void
-i386_save_dummy_frame_tos (CORE_ADDR sp)
-{
- generic_save_dummy_frame_tos (sp + 8);
-}
-
static struct frame_id
i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
frame_unwind_register (next_frame, I386_EBP_REGNUM, buf);
fp = extract_unsigned_integer (buf, 4);
+ /* See the end of i386_push_dummy_call. */
return frame_id_build (fp + 8, frame_pc_unwind (next_frame));
}
\f
/* ...and fake a frame pointer. */
regcache_cooked_write (regcache, I386_EBP_REGNUM, buf);
- return sp;
+ /* MarkK wrote: This "+ 8" is all over the place:
+ (i386_frame_this_id, i386_sigtramp_frame_this_id,
+ i386_unwind_dummy_id). It's there, since all frame unwinders for
+ a given target have to agree (within a certain margin) on the
+ defenition of the stack address of a frame. Otherwise
+ frame_id_inner() won't work correctly. Since DWARF2/GCC uses the
+ stack address *before* the function call as a frame's CFA. On
+ the i386, when %ebp is used as a frame pointer, the offset
+ between the contents %ebp and the CFA as defined by GCC. */
+ return sp + 8;
}
/* These registers are used for returning integers (and on some
set_gdbarch_print_insn (gdbarch, i386_print_insn);
set_gdbarch_unwind_dummy_id (gdbarch, i386_unwind_dummy_id);
- set_gdbarch_save_dummy_frame_tos (gdbarch, i386_save_dummy_frame_tos);
set_gdbarch_unwind_pc (gdbarch, i386_unwind_pc);