You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cursor moves to beginning of file while stepping if an exception occurs during a test #4692
I can reproduce this when debugging and an exception occurs. The exception breaks here:
And then clicking continue causes it to pause on the next frame up here:
I think this is because tokenPos in topFrame is -1 (see below). However, there is a function which has a valid location. I wonder whether the -1 is a bug or not - and if it's not, whether it's valid to use the location from function. I'll do some digging.
That said - even with this fixed so it doesn't jump to the top of the file, I don't know that it will solve this entire class of issue. If you hit an exception and click the Continue button, you're going to end up stepping up through a lot of code, so you may still end up in a different place to the test if the test wasn't the top stack frame.
changed the title [-]Cursor moves to beginning of file after debug test[/-][+]Cursor moves to beginning of file while stepping if an exception occurs during a test[/+]on Aug 21, 2023
Activity
DanTup commentedon Aug 21, 2023
I can reproduce this when debugging and an exception occurs. The exception breaks here:
And then clicking continue causes it to pause on the next frame up here:
I think this is because
tokenPosintopFrameis -1 (see below). However, there is afunctionwhich has a valid location. I wonder whether the -1 is a bug or not - and if it's not, whether it's valid to use the location fromfunction. I'll do some digging.That said - even with this fixed so it doesn't jump to the top of the file, I don't know that it will solve this entire class of issue. If you hit an exception and click the Continue button, you're going to end up stepping up through a lot of code, so you may still end up in a different place to the test if the test wasn't the top stack frame.
[-]Cursor moves to beginning of file after debug test[/-][+]Cursor moves to beginning of file while stepping if an exception occurs during a test[/+]DanTup commentedon Sep 6, 2023
https://dart-review.googlesource.com/c/sdk/+/324522
[dds/dap] Use function locations if frame has no location itself
DanTup commentedon Sep 23, 2023
Fixed by dart-lang/sdk@a780653. The change ships in the SDK, not the VS Code extension.