2 ms·
Its a tool, like a yellow hammer; useful when you need it. Since I write time-dependent C++ code I must test/debug the 'release' build. The debuggers universal
by JoeAltmaier 16y ago
Its a tool, like a yellow hammer; useful when you need it.
Since I write time-dependent C++ code I must test/debug the 'release' build. The debuggers universally screw up almost everything related to dynamic symbols (locals, parameters), so I have to read the assembler anyway to figure out what's where.
Naturally this makes it much quicker to use prints (logs actually) than struggle in the debugger.
- tonyarkles 16y agoWouldn't the print statements have the possibility of screwing up the optimized code (changing register allocations, for example)? Or screwing up the timing? (I realize a debugger would definitely screw up the timing)
- JoeAltmaier 16y agoSo I don't actually use prints; I make log entries in a system service with an enormous buffer. It takes negligible time, certainly compared with a debugger breakpoint! Unless we suppose a compiler bug, reallocating registers around a print (ok, log) is not a problem. It's still an order of magnitude faster than the 'debug' build.