Monday, April 25, 2011

What is your favorite open source debugging tool?

I've been giving a talk recently on a plethora of Open Source (some are borderline open-source, I'll admit) debugging tools and the audiences have been making great additions to my list.

I'd like to gather the knowledge (and give credit) to the oft-brilliant StackOverflow crowd on this same question.

There are no WebService/Java/.Net/HTML/Perl constraints of programming languages to this question. So far, I've been pontificating about:

  1. fs_usage for finding what keeps writing to disk so much
  2. lsof for debugging what ports or files are open
  3. tcpdump, wireshark, eavesdrop for looking at your network traffic (malformed data?)
  4. firebug for debugging css, javascript, and page loading issues
  5. SoapUI, poster, and for troubleshooting SOAP and RESTful web services
  6. Eclipse Memory Analyzer and VisualVM for Java memory usage and GC issues
  7. BTrace for instrumenting Java code already deployed to production servers
  8. curl for looking at raw HTML, sans browser redirects, and test-calling web services
  9. JMeter for load testing webapps and other supported components that fail under stress

What Open Source tools can you add to the list?

From stackoverflow
  • For the gcc crowd, there's gdb and gprof. I've gotten a lot done with those two.

    dmckee : My hat's off to, 'ya.
    jeffamaphone : Is there any other C debugger for Linux/Unix other than gdb? Gdb frustrates me to no end after having used ntsd... I would love to find ntsd's equivalent.
  • xdebug for PHP can be a godsend.

  • gdb is the king of course, and valgrind has its fans.

    For a nice open source GUI wrapper around gdb, see DDD. And yet another gdb front end - Insight.

  • For the java programmers out there why not try the Omniscient Debugger? It allows debugging in time (think time-travel) which is very handy.

    CoverosGene : I had a copy of RetroVue once upon a time. It did the same thing, but it was back in the days of Java 1.2 so it was very slow... too slow to be used to its full potential.
  • I wouldn't call it a favorite, but when you need it netcat is quite nice to be able to script network traffic.

  • printf("%s - %d: %d", __FILE__, __LINE__, variable );
    qDebug() << variable;
    

    ;-)

  • printf()

    Joachim Sauer : Either the min-length check isn't done when editing or the formatting crossed the line ;-)
  • As a C lover I like gdb.

  • I'll join the C crowd:

    gdb, valgrind, gprof.

    Edit: I'll join the Java crowd out there as well.

    Eclipse debugging tools, firebug,

    Joachim Sauer : firebug? It's nice, but has nothing to do with Java. It's a JavaScript debugger.
    Tom : yeah, i know, but i didnt feel like putting "ok, and i'll even join the JS crowd ". I'll be more carefull next time.
    Joachim Sauer : nevermind, I'm just alergic to the entire mix-up-Java-and-JavaScript-problem ;-)
  • Firebug for anything related to the web and Eclipse Debugger for stepping through java code. jUnit and Mockito are probably used most in my daily work, though not limited to debugging.

    Matthew McCullough : Can you hyperlink your tool references in your answer? It really increases the value for everyone. Thanks for the contributions. If you have any more in the Java space, fire away!
    Magnus : @Matthew Sorry, didn't think of that.
  • LLVM Clang Static Analysis. It's sweet.

  • python logging module.

    firebug.

    liveHTTP headers in firefox.

    Safari webinspector.

    When it comes to debugging web applications I never use stuff that adds debugging/logging info to the server's output.

    I also have my own wsgi middleware I use for debugging web apps. It dumps whole http responses in a database so It can be accessed numerous times. It can be configured to just dump stuff with 500 status code etc. This way I don't have to resend post requests with firebug when I'm debugging ajax stuff, it's also much easier to read this way.

    Matthew McCullough : Can you add hyperlinks to the liveHTTP and webinspector pages? Thanks for the idea contributions!
    Vasil : Added. The webinspector is installed with safari, you just have to activate it. But I'm not really sure about safari on windows.
    Eric Wendelin : +1 to liveHTTP headers. That's what I've been using to track HTTP request data in the browser.
  • function readVar($var)
    {
        echo '<pre>';
        var_dump($var);
        echo '</pre>';
    }
    

    I use this about one hundred times a day.

    On the client side, it's Firebug, or the primal classic:

    <script>
    alert('hello1');
    .......//borked code stops execution here?
    alert('hello2');
    .......//hmmm we shall see
    </script>
    

    :)

  • VisualVM might not be the most powerful tool in the Java-world, but it's got a very nice ease-of-use-to-power ratio.

0 comments:

Post a Comment