3 ms·
Embedded systems, where there are timing things going on, are an interesting special case. You can't just hit a breakpoint without (in the worst case) causing
by AnimalMuppet 6y ago
Embedded systems, where there are timing things going on, are an interesting special case. You can't just hit a breakpoint without (in the worst case) causing physical damage.
It's even worse if it's multithreaded as well. If you hit a breakpoint, one thread stops and the others keep going, but they keep going in an environment where one thread is effectively dead (the one at the breakpoint). Everything is invalid from then on, in all threads. So breakpoint debugging is certain to be doomed.
Print debugging is not doomed, but it's challenging. The problem is that the time to print out the message can change the timing, and therefore change what happens. It's not certain to do so, but it's something you always have to keep in the back of your mind: "What if this changed the sequence? What if what I'm seeing in the printouts isn't what I would see if the printouts weren't there?"