mgreg_t **save_locations,
StackFrameInfo *frame)
{
- gpointer ip = MONO_CONTEXT_GET_IP (ctx);
- gpointer fp = MONO_CONTEXT_GET_BP (ctx);
- guint32 sp;
-
memset (frame, 0, sizeof (StackFrameInfo));
frame->ji = ji;
*new_ctx = *ctx;
if (ji != NULL) {
- int i;
gint32 address;
- int offset = 0;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ gpointer fp = MONO_CONTEXT_GET_BP (ctx);
+ guint32 sp;
frame->type = FRAME_TYPE_MANAGED;
- if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ if (*lmf && (fp >= (gpointer)(*lmf)->ebp)) {
/* remove any unused lmf */
*lmf = (*lmf)->previous_lmf;
}
address = (char *)ip - (char *)ji->code_start;
- /* My stack frame */
- fp = MONO_CONTEXT_GET_BP (ctx);
-
- /* Compute the previous stack frame */
+ /* Compute the previous stack frame, assuming method
+ * starts with addiu sp, sp, <offset>. */
sp = (guint32)(fp) - (short)(*(guint32 *)(ji->code_start));
/* Sanity check the frame */
MONO_CONTEXT_SET_IP (new_ctx, new_ctx->sc_regs[mips_ra] - 8);
/* Sanity check -- we should have made progress here */
- g_assert (new_ctx->sc_pc != ctx->sc_pc);
+ g_assert (MONO_CONTEXT_GET_BP (new_ctx) != MONO_CONTEXT_GET_BP (ctx));
return TRUE;
} else if (*lmf) {
if (!(*lmf)->method) {