4 ms·
In a debugger you have to observe the changing state. If you print values you get a debugging log which (for me) is often more helpful, because I can easier ma
by rmetzler 10y ago
In a debugger you have to observe the changing state.
If you print values you get a debugging log which (for me) is often more helpful, because I can easier map it to the offending code line.
But it's good to have both tools available.
- kulu2002 10y agoprintfs are usually good. However when you deal with complex realtime multithreaded processes, sometimes high priority thread just pre-empts the printf, so you need to use somekind of flush statements ...this delays overall operations. In such cases debuggers are good 'to some extent'. I still haven't found the best way to debug hard realtime multithreaded applications
- douche 10y agoThose are exactly the places I find myself relying on printfs. In real-time, multithreaded code, you can't block on a thread and inspect things for a couple minutes and expect it to resume working afterwards.