|
|
|
|
|
by bloak
1039 days ago
|
|
I've used printf (or equivalent) more often than I've used a debugger but sometimes a debugger is the right way to find a problem. For example, you mention an "error message", but I've occasionally had situations in which a process running a binary built from a large code base that I have never even looked at (though I do have the source) dies for no obvious reason and with no useful output, but I've been able to restart everything, attach a debugger, and then, when it dies again, with great luck get enough information from the debugger to fix the bug faster than it would take to rebuild everything let alone insert printfs everywhere where they might help. Usually that's been in cases where I know roughly the sort of thing I'm looking for because I know the main differences between the system it's failing on and the systems it used to work on, though I have absolutely no idea where that sort of thing might be in the code that I've never looked at. If I'm running code I've just written myself I usually find I have no use for a debugger. |
|