R
Richard Heathfield
Richard said:
I disagree that it's intrinsic. Some people may well find it so, and that's
fine. A debugger is not a crutch of which to be ashamed, but a tool that
some people find invaluable and others less so. For my own part, I
generally find it most useful as an astoundingly fast way to analyse a
core dump.
Like many here, I've worked on small and I've worked on big - and some of
my most head-scratching bugs have been on relatively small systems (a few
thousand lines). It's odd, but I've found that multi-MLOC code tends not
to present as many problems. (I don't know why. Maybe it's just because
people tend to be a bit more conservative on larger systems, but that's a
guess really. It's odd.)
Well, actually no. If the program crashed, finding the cause is normally
little more than a formality for me. I'm sorry if that sounds like a
"pose"; it isn't meant to be.
No, the real head-scratchers are the non-crashing bugs, the logic bugs, the
"this output isn't what I expected" bugs. And even here, I have found that
ten minutes of careful thought is a good substitute for an hour with a
debugger. Of course, this may simply indicate that I never really used how
to use a debugger properly!
What is 3*4? And please do not say 12.
*Of course* I use printf (or rather, fprintf) to produce logging
information - and I can turn the log on and off at my leisure.
Perhaps you should. I don't normally use a debugger because I have found
that I take a long time to find bugs with them. It's entirely possible
that this is because I never learned to use one properly. On the rare
occasions when I /do/ use a debugger, I normally try divide-and-conquer
first. It's a workable technique, but perhaps you know better techniques.
A debugger is an intrinsic part of finding a deep rooted bug swiftly and
economically. It's why this exist.
I disagree that it's intrinsic. Some people may well find it so, and that's
fine. A debugger is not a crutch of which to be ashamed, but a tool that
some people find invaluable and others less so. For my own part, I
generally find it most useful as an astoundingly fast way to analyse a
core dump.
On what kind of code base? What size? How many contributors? How long
had you worked on that code? Who designed that code?
Like many here, I've worked on small and I've worked on big - and some of
my most head-scratching bugs have been on relatively small systems (a few
thousand lines). It's odd, but I've found that multi-MLOC code tends not
to present as many problems. (I don't know why. Maybe it's just because
people tend to be a bit more conservative on larger systems, but that's a
guess really. It's odd.)
Yup. Set a HW breakpoint on the conditions the stack trace showed to
cause the crash.
Well, actually no. If the program crashed, finding the cause is normally
little more than a formality for me. I'm sorry if that sounds like a
"pose"; it isn't meant to be.
No, the real head-scratchers are the non-crashing bugs, the logic bugs, the
"this output isn't what I expected" bugs. And even here, I have found that
ten minutes of careful thought is a good substitute for an hour with a
debugger. Of course, this may simply indicate that I never really used how
to use a debugger properly!
What are these techniques? And please do not say printf....
What is 3*4? And please do not say 12.
*Of course* I use printf (or rather, fprintf) to produce logging
information - and I can turn the log on and off at my leisure.
Most people who I have met who "dont need a debugger" ended up being
totally clueless on what one does or how to use it properly. I do not
accuse you of that I might add.
Perhaps you should. I don't normally use a debugger because I have found
that I take a long time to find bugs with them. It's entirely possible
that this is because I never learned to use one properly. On the rare
occasions when I /do/ use a debugger, I normally try divide-and-conquer
first. It's a workable technique, but perhaps you know better techniques.