![]() |
Forum Index : Microcontroller and PC projects : Debugging Woes..
Author | Message | ||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
I have a rather large project in development right now for the CMM2. things are progressing OK. The one thing that I wish we had was code stepping. Even if its just a feature to print out each line of code as it hits it. I know "TRACE LIST" is pretty much that, but I find its not that useful when you're executing thousands of lines of code. I primarily use "OPTION CONSOLE SERIAL", and use tera term to do my coding, with a vga capture into OBS, so I have the terminal on one half of my screen and the vga output on the other half. Works nicely. At the moment, I'm printing the values of various variables in a long line, for example, ? "var1: " ;: ? var1 ;: ? "var2: " ;: ? HEX$(var2, 4) This works well enough in most cases, but there's certain parts of my code where i'm not even sure it's being triggered, due to the nature of the program. I will say that I do appreciate the work that has gone into making the CMM2 such a pleasure to work with. Certainly has been interesting so far, and i've learnt a lot more than I expected from using it. One last thing, I haven't announced what this project is yet. All in due time ;) |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I often put in a PRINT "We are in the xxx routine" to know that I got to where I thought I should be. I also use MMEdit which lets me turn that sort of debugging on and off relatively easily. Jim VK7JH MMedit |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
As an aside, that is a bizarre construct and the following is I believe equivalent: ? "var1: "; var1; "var2: "; HEX$(var2, 4) i.e. you don't need the separate Print/? statements. Best wishes, Tom Edited 2020-07-28 20:45 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
MM_Edit looks to be a great piece of software, but I'm having trouble understanding how to use it exactly. Ah, fair enough. I knew that ";" ignores newline/carriage return, and I knew that ":" meant that you could have multiple statements on one line, so I assumed i'd need ;: and then the statement, which was a print statement, hence ;:? . Good to know, thanks! |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
For what it is worth you can also dispense with the semi colon between values in the PRINT argument list. So, this will also work: ? "var1: " var1 "var2: " HEX$(var2, 4) Geoff Graham - http://geoffg.net |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
? "var1: " var1 "var2: " HEX$(var2, 4) You live and learn ;-) MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Atomizer_Zero Senior Member ![]() Joined: 04/07/2020 Location: United KingdomPosts: 134 |
As i've said, I've learned so much by using this device. But there's certainly a MEGATON amount of things I need to learn still, which is great. Soon, i'm going to announce the project i've been working on, and then beg for help in speeding it up xD |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
I primarily use "OPTION CONSOLE SERIAL", and use tera term to do my coding, with a vga capture into OBS, so I have the terminal on one half of my screen and the vga output on the other half. Works nicely. At the moment, I'm printing the values of various variables in a long line, for example, ? "var1: " ;: ? var1 ;: ? "var2: " ;: ? HEX$(var2, 4) This works well enough in most cases, but there's certain parts of my code where i'm not even sure it's being triggered, due to the nature of the program. not exactly the single stepping you would like, but this is what I use when i have a particularly tricky bit of code that is playing up. Much better than TRON as you specify what the lines are called and they don't move about with the edits as you write your prog http://www.fruitoftheshed.com/MMBasic.Program-Step-A-Fast-Flexible-Debugging-Aid.ashx |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
We hit on at least an aspect of this last year: re TRACE Access to the TRACE LIST ring buffer would be helpful in the situation you describe, perhaps in the form of an mm.traceArray() array variable. [ watchdog reset does reset the TRACE LIST ring buffer ] But I will look into it. Any further thoughts on this? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |