2 ms·
Plenty. The difference is I'm using commercial tools (PyCharm, WebStorm, and IntelliJ) that have visual debugging that works. Now gdb from the command line is
by PaulHoule 2y ago
Plenty. The difference is I'm using commercial tools (PyCharm, WebStorm, and IntelliJ) that have visual debugging that works. Now gdb from the command line is great for what it is, but a lot of people who use open source toolchains find that "it just doesn't work" when it comes to debugging.
Myself, I think tests and debugging go together like peanut butter and jelly. That is, you use tests to set up a situation you want to debug, then you run the debugger. When you're all done you have a test that proves the bug was fixed.
It might be less of a problem in the C++ world but I really like being able to use the debugger to investigate a situation without touching the source code at all, since if you start hacking on the source code to add printfs and add other debugging hacks you often wind up checking in things accidentally that you shouldn't have, particularly when you're also making real changes to fix the bug.
An arXiv paper [1] investigates those accidental commits and reveals that people do a lot of printf debugging of async callbacks since those can be hard to debug; they breakpoint just find in most environments but you never really know if they are going to run or not and I think a lot times they get called N times for harmless things before you get the one you want to breakpoint. (Maybe it's just me but I've never had good luck with conditional breakpoints)
[1] https://arxiv.org/abs/2501.09892 https://arxiv.org/abs/2501.09892
- ai-christianson 2y ago> Myself, I think tests and debugging go together like peanut butter and jelly. That is, you use tests to set up a situation you want to debug The hardest things are the ones that come up in prod/after it is already deployed and there's no obvious error message or indication something is wrong. E.g. rn, I'm building a SWE agent (https://ra-aid.ai https://ra-aid.ai), and running it against SWE-bench lite. The processes will run for 5+ hours and then randomly hang. So for stuff like this, I rely heavily on: 1) Verbose logging 2) Tools that let you inspect/debug running processes, e.g. py-spy.