-
Notifications
You must be signed in to change notification settings - Fork 826
Open
Description
Hi,
I'm trying to retrieve the current line from a C method callback. I've got the following code. I don't know if its correct but it is returning line numbers with an offset. With ireps executed via mrb_read_irep() (with debugging info) the line numbers are 4 greater than they should be. When the files executed via mrb_load_file_cxt() they seem to be 1 greater than they should be.
const mrb_irep* irep = mrb.mrb->c->ci[-1].proc->body.irep; const mrb_code* pc = mrb.mrb->c->ci[-1].pc; uint16_t line = mrb_debug_get_line(mrb.mrb, irep, pc - irep->iseq);
How can I accurately retrieve the current line from within a C callback?
James
Metadata
Metadata
Assignees
Labels
No labels