by Veserv · 3y ago · 0 comments
Even primitive debuggers like gdb are not intended to be used like that. You theorize a failure mode, identify the proximal causes, then set breakpoints at the earliest suspicious points. You then examine the actual state to determine if your mental model of the code matches. You can then single-step to verify that the suspicious piece of code does or does not do the correct thing.
If you are feeling really adventurous and are willing to try technology that is only 20 years old you can use time travel debugging. Then you do not even need to think about how you debug. You just hit the bug then run backwards to the cause of the error. Then you examine the entire state of the universe at the time trivializing basically every bug.
You can use even newer stuff like high grade visualization of the entire program execution which trivializes bug detection, performance enhancement, and system understanding.
These articles always seem stuck 50 years in the past and even then seem to always be arguing that hammers suck because they keep trying to hit the nail with the handle.
Very interesting... what is the gdb-reverse-debugging equivalent for high grade visualizations of, for ex. cpp or python software? Something that's free, open source, generalizable
By GHS, developers of TimeMachine (TimeMachine created in ~2003), for C/C++: https://www.ghs.com/products/MULTI_IDE.html see “History viewer”
By the developers of rr (rr created in ~2013) for C/C++: https://pernos.co/
By former GHS employees for Python: https://functiontrace.com/
Usable FOSS time travel debugging is new enough that no follow on FOSS visualization has been developed as far as I know.