Author Topic: [dev build] $DEBUG mode ✨ Step through your code, watch variables! 🤩  (Read 41735 times)

0 Members and 1 Guest are viewing this topic.

FellippeHeitor

  • Guest
Latest development build available today brings the ability to watch UDTs - both simple variables and arrays. Also, watching _BIT variables is now minimally supported (no arrays of type _BIT though).



Still to be done:
- can't watch arrays with multiple-dimensions.
- can't set values of array elements yet.

FellippeHeitor

  • Guest
Every time a new dev build comes up, I advise those of you who are interested in keeping up with it to have a look at the recent commit list at https://github.com/QB64Team/qb64/commits/development, especially since there could be some minor thing that got fixed/added that maybe is interesting to you in particular but maybe not as expressive to add to the changelog.

The commits tagged with a ✅ are the ones that went up in the https://www.qb64.org/portal/development-build/ page.

Thanks to all who keep following us as the new features get implemented. 🤩

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Fell - I'm back, difficult past few weeks with death of very good friend.

Thanks for the array watch feature. I finally figured out that I need to shrink the size of my IDE in order to see the coding, watch list and output screen all at the same time. Do you have a recommended  or optimal Width and Height which you use? I presently changed the width from 240 to 120 and height from 63 to 31 but from what I can see in your videos your display seems to be some what longer.

I haven't yet figured out how to run the watch list in real time and see the code line being highlighted at the same time (which I see you can do in the latest video).

Also, it appears there is no "Run To" option which would  have your program run to a particular line and then pause.

Or by holding down the mouse button on "Step Into" that you run through the code just to see the changes in the watch list values a little faster than one click at a time.

Also, at the end of the program run and the we get the message "Debug session aborted" "Discontinued", is there a way to see the final values of the array in the Watch List?




FellippeHeitor

  • Guest
Hi, Dimster. Good to have you back, and sorry to hear about your loss.

Quote
Do you have a recommended  or optimal Width and Height which you use?
You'll really have to experiment with it, since our screens will vary. I, for example, have a second screen.

In the latest dev build, there's an option in the Debug menu to have the watch list be output to the console instead - works pretty well with a small list.

Quote
Also, it appears there is no "Run To" option which would  have your program run to a particular line and then pause.

Or by holding down the mouse button on "Step Into" that you run through the code just to see the changes in the watch list values a little faster than one click at a time.

There's a contextual menu accessible with a right-click that only appears while in $DEBUG mode. You will find "Run To This Line" there.

Regarding a faster way to step into,... well, I'm so used to only doing these debug actions by using the keyboard that I think you should try it too. I even forget we can click the buttons at the bottom, really.

Quote
Also, at the end of the program run and the we get the message "Debug session aborted" "Discontinued", is there a way to see the final values of the array in the Watch List?

Since there's no connection to the debuggee anymore when execution ends, I recommend you put a breakpoint at the very last line of your program, so you have time to inspect variable values one last time before execution is done with.

Thank you for trying it!

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Thank You

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Hello Fellippe ... Believe or not It's me again.

I just can't seem to get my $Debug to configure and work like your demonstrations. What I'm trying to achieve is the exact set up which you demonstrated in your YouTube video entitled "Watching array values in Real Time with $Debug" In your video you have 3 screens - the IDE with program code, the Watch List and the Output screen. Not only that but you are able to have some kind of continuous pausing which displays in the lower information window to indicate if the program is running or pause.

I cannot get the Watch List to continuous display and show the array values in Real Time. For me to achieve a display of the Watch List I have to fn a Step Into. My program is running too fast for me to pause and check the Watch List using fn - Step Into. I have tried the option "Output Watch List to Console" and it doesn't display as the 3rd screen either

I recall watching your YouTube video "Creating Console apps with QB64". In that video I believe you said that Windows does not display a continuous console screen but creates a new one each time $Console is called. Could this be the reason I'm having no luck in re-creating what you have demonstrated in "Watching array values in Real Time with $Debug" ??

My OS is Windows 10, I am playing with the lastest build e1c148a  64 bit.

FellippeHeitor

  • Guest
I cannot get the Watch List to continuous display and show the array values in Real Time.

What I'm doing in the video you mention is pressing F7 to advance to the next line. Is that what you're trying to do?

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Yes, I am using the fn key and F4, F5 and F7.

I start by selecting the Debug option from the menu. When the Debug menu displays the fn F4 from the keyboard will not work. I have to select the Watch List item on the debug menu using my mouse. Interestingly, when I first load the test program coding, without selecting Debug, I can get the Watch List using fn F4 from the key board but with the debug menu displayed fn F4 from the key board will not access the Watch List.

Once the Array is selected and I close the watch list, I can then fn F5 to run. At this point I get a message explaining which folder the exe will run in, it then creates the exe and runs. The only other screen which displays at this point is the Output screen, not the Watch List.

So I then place the focus back on the IDE screen and fn F7. The program pauses but I still do not get the Watch List screen. I have to hunt for it on the task bar and when I do find it I can no longer use fn and any of the other F keys because he cursor is flashing on the Watch List screen.

At this point my only option is to re-focus on the IDE screen but as soon as I click on that IDE screen, to get the cursor back, all the other screens disappear. I'm left with fn F7 working to pause line by line as in your video but there are no other screen displayed so I can follow the value changes in real time. All I can see is a green arrow moving line by line as I hit fn F7.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
I think Fell I'm asking tooooo much from my computer and monitor. I think my problem is actually in the sizing of the screens and 3 screens displaying at one time could be a bridge too far. I have been able to maintain the IDE screen with the coding and the Watch List (once I can find it on the task bar) displaying at the same time, and I am able to follow the changing array values with every fn F7 call. So in my case these two displays are very helpful and I'm going to abandon my attempts to display all 3 at once.

Now that's settled, I'm looking forward to exploring the wealth of buggy things I can get into.


FellippeHeitor

  • Guest
Latest dev build available brings the ability to change values of arrays/UDTs from the IDE.

Still to be done:
- can't watch arrays with multiple-dimensions yet.
- can't set _BIT arrays yet.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
On the Filter - "Multiple+Terms+Accepted" - When you have time would you be able to describe the limits you envision for this filter. If I have an array of 100 items, I believe this filter will let me view just a few of the items - ie in the Filter I would put 1,26,55,82 . Is that correct? But is the scope of the filter much greater, for example does Terms and Accepted mean the use of quasi IF's, like            filter 1,26,55,82 If > 10  ??


FellippeHeitor

  • Guest
The filter is just a temporary way to see less variables in the Watch List dialog, so you can find which variable you wanna add. Say you have thousands of variables and you're looking for all variables from a certain SUB, so you'd type SUB_ and the sub name, so only the list items pertaining to that scope will show, so you can double-click them to add to the panel.

You can also filter by data type (only STRING variables, for example), or by variable name.

"Multiple+Terms+Accepted" means you can combine those and find all string variables that are in Sub MySub, by typing STRING+SUB_MYSUB in the filter textbox, for example.

When you double-click an array you're able to specify an index range to watch (like 1-10) or several indexes (like 1,26,55,82) - but that's not related to the filtering capabilities.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Thanks - I have a lot of variables and arrays. So the filter will help me isolate a list of arrays with similar characteristics. Are there any plans for wildcard search characters in the filter?

FellippeHeitor

  • Guest
Right now, consider everything wrapped in wildcards. That means if you search for RIN you will see all STRING and RING and BRING that exist in your list.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Hey that's pretty cool. And it's agnostic as to capitalization. Has me re-thinking how I name my variables and arrays.