From 133ff5421f1871e22d5f5d21bab8a20396c2391c Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Sun, 28 Jul 2024 15:37:41 -0700 Subject: [PATCH] debugger: use current stack frame for 'this' Interpret 'this' expression in current call stack frame. --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 9369a01..b1dc80d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -590,7 +590,7 @@ error: static union vm_value dbg_eval_object(struct parse_object *object, struct ain_type *type_out) { if (!strcmp(object->ident->text, "this")) { - int32_t page_i = call_stack[call_stack_ptr-1].struct_page; + int32_t page_i = call_stack[call_stack_ptr- (dbg_current_frame + 1)].struct_page; if (page_i < 0) { DBG_ERROR("'this' used outside of method"); goto error;