Settings

Theme

Debugging In Vim

zschoche.org

56 points by zschoche 12 years ago · 16 comments

Reader

jamesmiller5 12 years ago

I have also had a great time using `ddd` which is a lovely front-end for GDB. It's memory visualizer has helped me tremendously when learning complicated data structures.

cel 12 years ago

Similarly, debug JS in Vim (also using the netbeans protocol):

node-vim-debugger https://github.com/sidorares/node-vim-debugger

presentation: http://andreysidorov.com/presentations/melbjs/0913/

  • lightblade 12 years ago

    Is this ready yet? I can't seem to find the node-vim-inspector.

    • cel 12 years ago

      Looks like the npm package is out of date. Try cloning the source repo and running ./bin/node-vim-inspector.js

ktf 12 years ago

I highly recommend vdebug (https://github.com/joonty/vdebug) if you're looking for a great Vim interface to DBGP debuggers (for PHP, Python, Ruby, Perl, Node, etc.). Really nice, especially compared to the countless half-broken and out-of-date Vim/DBGP plugins that are scattered around vim.org and github.

  • puller 12 years ago

    Maybe this is great for PHP, where DBGP is the standard, but...

    I tried this for Python and was greatly put off by the need to download an obscure debugger tarball from ActiveState with some weird license on it, then (according to the vdebug documentation) run a very long command line by hand passing the name of the script every time I want to debug something.

    If I am going to trouble myself with that, it's hard to understand why I don't just run a standard standalone debugger which works in the expected way, from the command line. I definitely don't see how it reproduces the experience of (say) pressing a debug button in Visual Studio or Xcode.

    • ktf 12 years ago

      Yeah, I guess I should have qualified the above by saying that I've only used it with PHP/xdebug (so far).

      Still, if you're trapped in the DBGP world for whatever reason, vdebug is miles better than any competition that I've found.

CraigJPerry 12 years ago

The site appears to be down for now but i got to the content via fullhn.com (there doesn't appear to be a permalink i can list for there, it's currently fullhn.com/#article-5)

Blinkky 12 years ago

Have a look at cgdb, it's gdb with a UI modeled after vim.

http://cgdb.github.io/

DiabloD3 12 years ago

I don't get why you'd want a debugger in Vim when you could just use tmux to get what you want in a cleaner way.

  • JoshTriplett 12 years ago

    I'd like to single-step through the code displayed in a vim editor window, with all the power of vim to navigate it, plus commands to single-step, watch variables, set breakpoints, etc. tmux or screen can't give me that, nor can gdb -tui.

    • jmcdowell 12 years ago

      I was looking for the same thing, ended up using ddd, has watches, breakpoints etc. If you've found a better solution than that though feel free to let me know.

      • JoshTriplett 12 years ago

        For everything except the data structure graphs, I prefer gdb's -tui option (split-screen code and "(gdb)" prompt) over ddd.

  • tareqak 12 years ago

    One feature I can think of jumping to line numbers which come from make or compiler errors.

    • chongli 12 years ago

      Vim has that with its quickfix window.

      • dllthomas 12 years ago

        For live debugging there's still a need for some way of getting the source locations you're interested in into that quickfix window. Not that there aren't probably plugins &c that do just that, but it doesn't fall out as straightforwardly as parsing build errors.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection