1

I am trying to use :Termdebug in Vim 8.1 on a CentOS machine. The default version of GDB at /usr/bin/gdb is less than the required v7.12. However, I have newer versions of GDB within devtoolset distributions I have installed with yum. To enable newer GDB versions, I need to run source /opt/rh/devtoolset-{version}/enable.

I don't want to source that script in my .bashrc and disrupt my default environment. Is there anyway I can run that command on running :Termdebug?

Is this possible with :TermdebugCommand?

1
  • You could try setting the g:termdebugger variable to the gdb you want to run. Oct 31 '18 at 18:02
1

As pointed out by Christian (all credits to him) in this comment, setting g:termdebugger does the trick. Put this into your .vimrc:

let g:termdebugger='/path/to/your/gdb'

Single quotes are needed.

0

You can always have a look at that enable script and interpret it if it's simple enough like setting a bunch of environment variables: PATH=...;LD_LIBRARY_PATH=....

This is what I've done in an unpackaged plugin that wraps lmod module command.

(module permits to work on complex environments (like HPC clusters) where numerous softwares, compilers, etc are installed. Some are compatible between them, some are not. With module we can dynamically enable or disable what we need at a given time. On such systems, devtoolset scripts would be typically converted into a lmod module script)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.