dotfiles/gdb/.gdbinit.d/init
Sanchayan Maity 0b7a19555a gdb: Add gdb configuration based on gdb-dashboard
For the most part adapted from
https://gavinhoward.com/2020/12/my-development-environment-and-how-i-got-there/

Also contains support for opening current line in neovim.

This assumes we are running inside neovim terminal and hence the use of
nvr viz. neovim-remote. We will try adding support for kitty window and
single instances later if possible.
2021-10-05 12:58:49 +05:30

17 lines
407 B
Text

set confirm off
set breakpoint pending on
set print pretty on
set auto-load safe-path /
set logging off
# Adapted to use neovim from https://github.com/cyrus-and/gdb-dashboard/issues/20
define vo
python
import os
sal = gdb.selected_frame().find_sal()
current_line = sal.line
if current_line != 0:
openInNvim = "nvr +" + str(current_line) + " " + sal.symtab.fullname()
os.system(openInNvim)
end
end