-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger doesn't understand conditional breakpoints #385
Comments
FYI - Changing the break expression to "iAns=7" (no spaces) - changed nothing. |
Additionally - setting a breakpoint on the End Select line was skipped. |
Hi @mburns08109 thanks for opening this issue. The debugger does not yet understand conditional breakpoints at all. As a first step, we'll add an error message if the user tries to add a conditional breakpoint. And then a little later we'll look to add conditional breakpoint support.
As the debugger doesn't understand conditional breakpoints, it will currently see the conditional breakpoint as an ordinary breakpoint for the moment, so this behaviour is expected. However, even if this feature was implemented, your expectation for this to stop on the vbNo line is not correct. It would only stop there if you had put the conditional breakpoint on that line (not at the top of the procedure). The debugger is expected to evaluate the expression you've entered immediately before deciding whether or not to break on the line where you've set the breakpoint (not on any other line being executed in the procedure). Note that the conditional breakpoint feature is NOT the exact equivalent of the 'Break When Value Is True' option in the VBx Watch Window debugger (see #76 for that). |
v0.10.4980 now displays a warning that it is unsupported when you add a conditional breakpoint. We'll leave this issue open to track the actual support for conditional breakpoints. |
Oh - not sure if you saw it, but as I'm new to the twinBasic bandwagon...how do I see the current compiler version? |
|
As @uwbwsvd mentioned, the version number can be seen in the extension panel, but it can also be seen in the debugger callstack window: With regards to getting updates, this is handled by VS Code. If you haven't changed any VS Code settings, then the default behaviour is that VS Code will download and install extension updates automatically for you. twinBASIC updates require a restart of VS Code, so if you go to the extension panel you will often see [Reboot Required] next to the twinBASIC extension as updates are pushed out very frequently. |
As of v0.10.5070, conditional breakpoints are now supported. To set conditional breakpoints in VS Code, right click in the gutter (where you would normally click to set a breakpoint), and then you'll see the 'Add Conditional Breakpoint...' option. Enter an expression such as 'Index > 500' and twinBASIC will only break at that line if that condition evaluates to TRUE. |
Describe the bug
First: I enhanced the HelloWorld.twin code as follows:
Public Sub Main()
Second: I set an Expression breakpoint "iAns = 7"
This breakpoint attached to the Public Sub Main() line in the VSCode Editor.
At EVERY run, on startup, this breakpoint was hit and stopped execution AT the Public Sub Main() line.
When told to continue running, the code ran as expected. EXCEPT, when NO was chosen on the 2nd msgbox line, The Breakpoint was IGNORED.
To Reproduce
see above
Expected behavior
Note: If the breakpoint is specified as iAns - vbNo....the breakpoint is never hit (the debugger seems not to understand the predefined VB/VBA constants). This should ALSO work as expected.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: