-
I'm adapting my current debugger based on void lua_breakpoint(lua_State* L, int funcindex, int line, int enabled) seems to take a lua function on the stack as argument. My idea then is to save all "whole file"-function references from requiring files in a hash somewhere, and from the filename push the function representing the entire file onto the stack, then call lua_breakpoint. Is this how its supposed to work, kind of? I'm thinking maybe its wisest and easiest to use a lua table for this storage? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yeah that's correct. If you're doing this from the C code, then using
|
Beta Was this translation helpful? Give feedback.
Yeah that's correct. If you're doing this from the C code, then using
lua_ref
is probably the easiest way to store the functions - you can just store top-level functions after luau_load, since lua_breakpoint will find the right sub-function to put a breakpoint into. You'll need to calllua_getref
before using lua_breakpoint, eg