Are debuggers becoming obselete?

May 29th, 2009 by admin | Filed under GDB Debugger

Are debuggers still useful? The main use of GNU debugger (gdb), for me, is to make sure I get a stack trace, like in Java. Putting break points and watching variables is just not something I do outside the code. Putting asserts and various checks in the code is far more valuable in my opinion even if it “dirties” (to dirty) the code.

One issue you must not forget about debuggers, is that once your code is deployed, you no longer have a debugger running on your client’s machine. Even if you don’t release your code, others might have to use it, and they may have trouble with it… What is worse is that some nasty problems only occur outside the debugger. I’ve never seen this happen under Linux, but I have seen i happen again and again under Windows. Also, consider that most modern applications are web applications. Of course, you can run a web application in “debugging” mode, but it is quite the same as web applications tend to be distributed (web server, database, etc.). I think you need to learn to debug applications live.

I will also add that it is well known that the Linux kernel is built is C with printf statements. If you can build something so complex without a debugger, using a nasty language like C… then debuggers are not so useful.

What I find tremendously useful are unit tests. We never have enough unit testing. And I don’t think it is stressed enough in the curriculum. If there is one thing you must learn from modern software engineering, it is not UML, it is not business processes, it is unit testing.

Is this supposed to be a highly-commented-on controversial topic, or one that helps people? :^)

I must admit, sheepishly, that I’ve always been too lazy to learn to use a debugger and still rely on printf or the equivalent. Often, determine that the bug is more than 100,000 iterations into a 1,000,000 iteration loop; do any debuggers provide breakpoints that only trigger after being passed through n times? A binary search through the loop iterations is a fairly quick thing to do with a test and printf.

"...most modern applications are web applications."

Now you’re really just pandering for comments! Everyone knows most applications are embedded. – Comment by Michael

Yes, this is supposed to be an highly-commented-on controversial topic. I agree with your analysis regarding debuggers.
Regarding embedded applications versus web applications, do you really think there are more distinct embedded applications than web applications?
Comment by Daniel

I find the rbreak command of the gdb useful for understanding how modules are used in large programs. Suppose that all functions exported by module A starts with A_xxx, then setting rbreak ^A_.* and running the program gives us a clue how the module A is used.
Comment by uccai_siravas

Daniel Lemire, http://www.daniel-lemire.com/blog/archives/2006/01/03/are-debuggers-obselete/

Related Posts:

  • No Related Posts
tag_iconTags:

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a comment.

To leave a comment, please fill in the fields below.

Powered by Yahoo! Answers