luau-lang / luau

A fast, small, safe, gradually typed embeddable scripting language derived from Lua
https://luau.org
MIT License
3.98k stars 373 forks source link

Breakpoint not triggering #1231

Open bkerec opened 5 months ago

bkerec commented 5 months ago

Let's say that we have the following code:

1| if condition then
2|    ...
3| end
4|
5| local var = 1

Calling a lua_breakpoint on line 3 should place the breakpoint on line 5, but debugbreak callback is never called. Everything works as expected if I call lua_breakpoint on line 5 directly.

Another thing I observed is when I run this code in an update loop (each iteration I call lua "update" function from c++ code) and I execute the following:

debugbreak callback will be called (VM is "idling" between BP calls), but if I execute the same sequence from within debugbreak callback (VM execution never "idle"), it will not be called.

Is that an actual bug or it might be something wrong with my setup or is this behavior expected and nothing is broken?