0

OK, so there are numerous questions around, asking for a "Visual Studio equivalent on Linux" or a variation of this question. (here, here, here, ...)

I would like to focus on one aspect and ask how the debugging workflow possibly differs on different systems, specifically the full-integrated-IDE approach used by Visual Studio (like) systems and a possibly more "separate" toolchain oriented approach.

To this end, let me present what I consider a short description of the "Visual Studio Debugging Workflow":

  • Given an existing project
  • I open up the project (one single step from a user perspective)
  • I navigate to the code I want to debug (possibly by searching of my project files, which is simply done by opening the Find in Files dialog box.)
  • I put a breakpoint at line (a), simply by putting the cursor on the line and hitting F9
  • I put a "tracepoint" at line (b), by adding a breakpoint there and then changing the breakpoint properties so that the debugger doesn't stop, but instead traces the value of a local variable.
  • I hit F5, which automatically compiles my executable, starts it under the debugger and then I wait until the prg stops at (a), meanwhile monitoring the trace window for output of (b)
  • When the debugger finally stops at (a), my screen automatically shows me the following information in (one-time preconfigured windows) side-by-side at the same time:
    • Current call stack
    • values of the most recently changed local variables
    • loaded modules (DLLs)
    • a list of all active breakpoints with their locations
    • a watch window with the last watch expressions I entered
    • A memory window to examine raw memory contents
    • a small window displaying current register values

Plus/minus some features, this is what I would expect under Eclipse/CDT under Linux also. How would this workflow and presented information be retrieved when developing with VIM, Emacs, gdb/DDD and the likes?

This question isn't really about if some tool has one feature or not, it's about seeing that development/debugging work is using a combination of features and having a multitude of options available at your fingertips and how you access this information when not using a fully integrated IDE.

Community
  • 1
  • 1
Martin Ba
  • 37,187
  • 33
  • 183
  • 337

1 Answers1

2

I think your answer isn't just about which software you use, but also what methodology you use. I use Emacs and depends on TDD for most of my debugging. When I see something fail, I usually write tests filling in the gap which I (obviously) have missed, and checks every expectation that way. So it goes far between each time I use the debugger.

When I do run into problems I have several options. In some cases I use valgrind first, it can tell me if there is some memory related problems right away, eliminating the need for the debugger. It will point straight to the line where i overwrite or delete memory that should be left alone. If I suspect a race condition valgrind is pretty good at that to.

When I use the debugger I often use it right in emacs, through GUD mode. It will give me a view with stack, local variables, the source code, breakpoints and a window where I can command the debugger. It usually involves setting a couple of breakpoints, watching some memory or some evaluation, and stepping through the code. It is pretty much like using the debugger in an IDE. The GDB debugger is a powerful beast, but my problems has never been large enough to need to invoke its power.

daramarak
  • 6,115
  • 1
  • 31
  • 50
  • Just to clarify: With TDD I assume you refer to TestDDRiverDevelopment and with GUD you refer to [GrandUnifiedDebugger][http://www.gnu.org/software/emacs/manual/html_node/emacs/Debuggers.html] – Martin Ba Nov 11 '10 at 13:09
  • No, TDD Test driven developing. It is not software it is methodology. – daramarak Nov 11 '10 at 13:21
  • Ah, I see now how you misspelled it. My bad I should have noticed that it only was a spelling err. And yes GUD is the grand unified debugger. – daramarak Nov 11 '10 at 15:28
  • +1 - I couldn't tell you how long it's been since I last used a debugger. – Dave Sherohman Nov 23 '10 at 13:08