Ability to step in the Arduino IDE

I remember my old Turbo C++ days where the IDE had a debugged that allowed the progam to step line by line in the order as the program progressed. With each step we were able to see the values of variables change. That ability would be nice in the Arduino IDE.

You ran Turbo C++ code on a flash-based microcontroller?

Lymphomaniac1:
I remember my old Turbo C++ days where the IDE had a debugged that allowed the progam to step line by line in the order as the program progressed. With each step we were able to see the values of variables change. That ability would be nice in the Arduino IDE.

I wish that Arduino IDE could be added that ability. I don't like have to print out every things in order to know what are happened in the microcontroller. Obviously, it would be more convinient and save a lot of time.

The program that you want to debug is NOT running on the same computer as the debugger. Don't you imagine that that adds to complexity? Don't you think that you'd have to have more code on the computer running the program that could communicate with the debugger, to be able to do things like single step, report the value of a variable, change the value of a variable, etc.? Do you really think that the Arduino has memory and bandwidth to spare for that?

Do you really think that the Arduino has memory and bandwidth to spare for that?

Yes. After all, Atmel Studio can do it with a an Atmel Xplained Mini 328p board (which is essentially similar to an Arduino Uno.) The ATmega chips used on arduino explicitly support an out-of-band debugging protocol. (unfortunately, Atmel has chosen not to document this protocol.) Furthermore, slower computers with less memory and more primitive built-in debugging capabilities used to support debugging.

Now, even neglecting the non-documented status of the debugging protocols, there are problems with the Arduino hardware design that make debugging a bit of a pain to implement on the Arduino, AND it wouldn’t be as wonderful as people might expect due to the whole “many things are happening at once” aspect of microcontrollers, and figuring out where a line of C code begins and ends is trickier than you’d think. But it is surely POSSIBLE. The biggest problem is trying to make it as easy to use as the rest of the Arduino IDE, for the target audience.

Arduino Zero has debugging support built-in, but “how to use it” has not been solved. :frowning:

You can use elf file for debugging simple projects using Proteus. I made special virtual machine (rus) for this for myself. This is hard but possible. It is better than nothing.