gdb which shows source code on top of the screen I would like to see this in my Vim editor that would jump between tabs, and buffers accordingly.
How can I do this?
The workflow with ConqueGDB consists not entering GDB commands on the GDB terminal, you use shortcuts on the vim source code. But you can continue using the GDB prompt if you want, for more advanced commands, or scroll to see the whole debug session.
Some ConqueGDB default mappings, for example:
Notice how the vim cursor line has been used to issue a GDB 'print row', the current execution of code is in another line (14) and there's a breakpoint on line 10.
To install with Vundle for example:
I use these plugin options:
let g:ConqueTerm_Color = 2 " 1: strip color after 200 lines, 2: always with color let g:ConqueTerm_CloseOnEnd = 1 " close conque when program ends running let g:ConqueTerm_StartMessages = 0 " display warning messages if conqueTerm is configured incorrectly
You have several plugins that integrates gdb.
And there is also a plugin that integrates lldb (from LLVM project)
It seems that Bram is currently (september 2017) working on the integration of gdb from within vim thanks to the new
:terminal feature. To use it, we need to load
termdebug packet (with
:packadd termdebug), then we'll be able to start a gdb console in a vim window with
:TermDebug (+options). IMO, we can consider it to be the future of GDB integration under Vim.
Opens an editor on the current line using the command:
$EDITOR +<current-line> <current-file>
vim also understands the
When you quit the editor, you get back into
This allows you to browse the source freely and is specially powerfull if you have
This is a poor-man's built-in one way gdb to vim integration: the main missing thing is setting breakpoints from Vim.
edit and center
edit does not center Vim by default around the source, so I've created a Python script that does it: https://stackoverflow.com/questions/43557405/how-to-open-the-current-file-at-the-current-line-in-a-text-editor-from-gdb/43557406#43557406
Breakpoint command to clipboard helper
This vim command copies a breakpoint specifier of type:
to the clipboard:
command! Xg :let @+ = 'b ' . expand('%:p') . ':' . line('.')
Then you can just paste that into
This is a poor man's vim to gdb integration to ease setting breakpoints.
Although not technically vim. cgdb is a curses version of gdb with vim-like keybindings. It's been my goto debugger for years: