14

In emacs there is a handy way to launch the gdb and gui options for gdb, the C debugger.

Is there a similar option in gvim?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
zxcv
  • 7,391
  • 8
  • 34
  • 30

8 Answers8

7

There's a project called cgdb which aims to provide this exact behavior. While it doesn't launch from vim the way emacs does, it provides vim like keybindings and behavior. Its features include a separate syntax highlighted source window which is kept up-to-date with the currently executing instruction.

pk.
  • 420
  • 2
  • 6
6

Have a look at the Vim script search. I see at least 5 plugins that do what you want.

jkramer
  • 15,440
  • 5
  • 47
  • 48
2

To complete jkramer's response, there is also pyclewn.

Community
  • 1
  • 1
Luc Hermitte
  • 31,979
  • 7
  • 69
  • 83
1

Conque GDB is what you are looking for.

See http://www.vim.org/scripts/script.php?script_id=4582

and http://www.youtube.com/watch?v=ZcSjaYSoqnc

Druesukker
  • 249
  • 3
  • 10
0

Perhaps Agide is what you are looking for: http://www.a-a-p.org/ It's some kind of an open framework for using vim and gdb like an IDE.

kongo2002
  • 1,006
  • 5
  • 11
0

If using neovim, please check my new nvim plugin gdb frontend: neogdb.vim.

feature

  • gdb commands maps: next, step, finish, continue, etc.
  • breakpoints:
    • auto save/load,
    • populate to local list: lopen
    • side color sign
    • triple state: enable -> disable -> delete
    • toggle current line/toggle-all-breakpoints
    • support condition set
  • backtrace:
    • populate to quickfix: copen
wilson
  • 1
0

IMHO, NONE of vim's gdb plug-ins works RELIABLY mainly because vim doesn't natively support shell integration. I use emacs+vimpulse.el. (vimpulse.el is an emacs package that emulates vim.) emacs+vimpulse.el behaves very similar to vim, and emacs supports gdb as nicely as anything out there. cgdb is very good too, but I prefer emacs+vimpulse because I don't have to remember shortcut keys in emacs. (M-x gud- shows all possible debug commands, and shortcut keys are reminded whenever a command is executed.) Also, emacs is much more customizable than cgdb.

tbear
  • 552
  • 4
  • 6
-2

I don't think there is. I use different windows.

The only thing I can think of is

!gdb blah blah blah

but that may not be what you are looking for. It tends to be used to generate batch text that gets plugged back into the file you are editing.

Hope this helps.

bog
  • 1,513
  • 7
  • 12