I can't reliably step through RenderStepped code in the debugger

When I am stepping through code in RenderStepped, the debugger will sometimes jump into other pieces of code. This is terrible for productivity and makes me not want to use the debugger. Trying to use it is just a waste of time if it does stuff like this.

This bug report contains a trivial example of this problem, along with a couple of more complex ones: Stepping through code in RenderStepped sometimes teleports to a breakpoint incorrectly

The staff response to the bug report was:

Hi this is working as designed. If you have a breakpoint in multiple threads, it’s going to break in every thread.

This doesn’t make sense to me. None of the code I am stepping through does any yielding or thread-related stuff. Yeah, I expect weird stuff to happen if my code has a task.wait() or a network request or whatever in the middle of it. But that’s not what’s happening here - this issue happens just with plain old immediate code.

The model of the engine you expose to developers suggests that pausing in the middle of a RenderStepped will prevent any future frames or RenderSteppeds or Luau code or whatever from running. That’s how debugging seems to work in all other situations (e.g. server-side and client-side heartbeat, stepped, remote event callbacks). It’s bad that this guarantee is not maintained for RenderStepped.

2 Likes