Is there a way to debug a program on V5?

I am wondering if there is a way use a debugger on a program in the V5 brain, I have a script that has a memory permission error, and while I am sure that the community could quite easily fix it; I would like to be able to fix it myself. There are other cases where I would like to run a debugger to see when my program does something unexpected.

1 Like

Really the only way is to comment out code until it works or put print statements every few lines so you can find where it crashes.

2 Likes

Thank you.
How can I see the output of the print statements? I am using VEXCode.

what I do is I comment out lines I think may be an issue, until the program doesn’t break, then I slowly narrow down what lines are causing the issues by uncommenting one line at a time.

1 Like

The easiest way would probably be to write to the v5 screen.

1 Like

If you’re downloading wired, you can send output to the terminal and view that. You should be able to use std::cout << “print this stuff”;

2 Likes

The only real time debugger I know of right now is in Robot Mesh Studio’s Python (and Blockly, which generates Python). For any of the C++ options out right now, you’re going to be stuck with the old methods of printouts and etc.

4 Likes

If you use PROS, they have a feature that prints out the current stack address to the terminal, so you can use addr2line to figure out where the segfault is in the code.

2 Likes