Skip to content

What is a good way to call lua_breakpoint when implementing a debugger? #244

Answered by zeux
JDaance asked this question in Q&A
Discussion options

You must be logged in to vote

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 call lua_getref before using lua_breakpoint, eg

lua_getref(L, stored_idx);
lua_breakpoint(L, -1, line, enabled);
lua_pop(L, 1);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JDaance
Comment options

@JDaance
Comment options

Answer selected by JDaance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants