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

0 Members and 1 Guest are viewing this topic.

Offline doppler

  • Forum Regular
  • Posts: 241
Saves you lots of trouble.

No pain, no gain.
Besides this is to push the screaming masses in the proper coding direction.  I now use it exclusively since I noticed the benefit in coding.

FellippeHeitor

  • Guest
Ctrl+C when the variable list is focused in the F4 dialog will copy the list to the clipboard 😉

Offline doppler

  • Forum Regular
  • Posts: 241
Ctrl+C when the variable list is focused  😉

I will have to remember this one.  Hopefully others will to.

Offline Dimster

  • Forum Resident
  • Posts: 500
Thanks Fell .... I'm an fn pausing maniac now. Time to put this new toy to work. Can't wait to mess with the Arrays.

FellippeHeitor

  • Guest
New dev build available today, from git 70b6f7b, with preliminary support for watching array elements:

Known limitations:
- doesn't check for lower/upper limits of arrays, so it's up to you to respect those, or your program will crash.
- for now, for an array defined with limits not starting at 0, like DIM a(5 to 10), for example, treat those as 0-5 when choosing which indexes to watch.
- can't watch arrays with multiple-dimensions.
- can't set values of array elements yet.
- UDTs not implemented yet.

Mandatory reminder that you shouldn't add too many array elements, or too many variables, to the watch list at once. The idea of watching values is to inspect those you believe are acting weird in your program so you can find where a bug is hiding.

Quick demo:


FellippeHeitor

  • Guest
Correction:
- for now, for an array defined with limits not starting at 1, like DIM a(5 to 10), for example, treat those as 1-6 when choosing which indexes to watch. Watching index 0 will crash it.

Offline doppler

  • Forum Regular
  • Posts: 241
@FellippeHeitor I am seriously concerned for your health.  Do you get enough sleep?  I got this mental image of you sitting cross legged in your chair with only your underwear on.  Eating Hot-Pockets (The Core Movie) and coding qb64-debug day -n- night 24/7/365.

FellippeHeitor

  • Guest
I'm doing ok, thank you for your concern. Now stop picturing me in my underwear 😂

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
I'm doing ok, thank you for your concern. Now stop picturing me in my underwear 😂

OH GOD!!  I JUST PICTURED FELLIPPE SITTING WITHOUT HIS UNDERWEAR ON!!  MY BRAIN’S EYE NEEDS BLEECHING!!
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
( ͡° ͜ʖ ͡°)

FellippeHeitor

  • Guest
Another PS, latest version comes from git 30d6782.

Offline Dav

  • Forum Resident
  • Posts: 792
Wow, I go away a while and come back to a great new feature added.  Maybe I should go away again and see what happens.

I'll be downloading and trying this out!

- Dav

FellippeHeitor

  • Guest
@Dav - don't keep disappearing! But glad you like the new feature 🤗

Latest dev build generated today (don't focus on the commit id, focus on the date) contains the following tweaks:

- Array elements can now be watched in real time regardless of the lower boundary - even index 0 can be properly watched.
- Data transfer from debuggee to the IDE is now a bit more efficient (you will see faster updates in the Watch Panel as you step through your code).
- _ConsoleTitle should work ok with $Debug now.

Still to be done:
- can't watch arrays with multiple-dimensions.
- can't set values of array elements yet.
- UDTs not implemented yet.
« Last Edit: August 20, 2021, 11:23:54 am by FellippeHeitor »

Offline hanness

  • Forum Regular
  • Posts: 210
Confirmed: At least for me, this build is working with _ConsoleTitle

Question: With the change of focus between the output screen and the IDE, would it make sense to change focus to the output screen when a "Shell" command is run?

I was thinking that this might be nice because Shell may be calling something that requires input from the user. On the other hand, it's possible that Shell may be calling something that requires no input at all. I'm not sure if there is any way to detect whether what is being run via Shell is looking for input or not, so if this is a dumb idea, please do feel free to let me know :-).

Offline doppler

  • Forum Regular
  • Posts: 241
@FellippeHeitor After viewing the use of single dimension array watching, I have come to the conclusion that a console window should be used to paint the results.  The watch box created is going to become very busy.  Or very overloaded on occasion. (re: multi-dimensions)  Being able to move the watch box to either another monitor, or task view virtual window is going to become necessary.  For people who can't afford a bigger monitor this would be a blessing.  Moving to a task view virtual window is going to be hell to do. But it maybe a way for people who can't even afford even a second monitor.

Keep it up, getting better with every DEV release.