blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

Debug-stopping at the end of a void-function stops at the next statement in the parent function. #18

Closed Pharmhaus-2 closed 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: ImmutableOctet

Not sure if this is a Monkey 2 debug problem or a Ted2/Ted2Go problem, but... Trying to use 'DebugStop' at the end of some functions yields an incorrect breakpoint. In the following example, you'll find that the user stops in the function above the one intended to be debugged.

Function Main:Void()
    Print("Main()")

    Test()

    Print("Done.")
End

Function Test:Void()
    Print("Test()")

    DebugStop()
End

This happens specifically without an explicit 'Return' statement.

Basically, execution stops before the next expression happens, but it doesn't stop in the 'Test' function where the actual break-point is. This means you can't stick a 'DebugStop' at the end of a function to view its local variables.

Pharmhaus-2 commented 5 years ago

Seems to be fixed in current develop.