To add a switch to allow Termdebug to send continue instead of run when doing :Termdebug!.
Use case: when need to connect to a remote gdb server automatically though command line to launch Termdebug, it is possible to start Termdebug and manually do target remote ..., but it is annoying to do that especially if it needs to be repeated for several times.
So, this can be put to a vim file, e.g. remote_termdebug.vim, then can launch vim as vim -c 'source remote_termdebug.vim' -c 'exe :Termdebug!'
let Termdebug_remote={cmd, pty -> [join(cmd), "-q",
\ "-tty", pty,
\ "-l", 120,
\ '-iex', "set pagination off",
\ '-iex', "set mi-async on",
\ '-iex', "set sysroot /",
\ '-iex', "set tcp auto-retry on",
\ '-iex', "set tcp connect-timeout 120",
\ '-ex', "echo Waiting for gdbserver connection ".g:gdb_port." (2mins) ...\n",
\ '-ex', "target remote localhost:".g:gdb_port,
\ g:gdb_x_opt, g:gdb_x_opt_value,
\ '-ex', "echo startupdone\n"]}
let g:termdebug_config={
\ "command": 'gdb',
\ "command_add_args": Termdebug_remote,
\ "remotemode": 1,
\ "wide": 320}
Use command_add_args to "hijack" Termdebug gdb launch commands. This does not work with use_prompt: 1 though.
g:gdb_x_opt, g:gdb_x_opt_value can be used to load extra file containing gdb command such as set up breakpoints etc.
It would be much nicer if all can be done with :Termdebug <host>:<port>, but that probbaly requries much more changes and it is over my current capability.
https://github.com/vim/vim/pull/12522
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I may created the pull requests including a merge commit by mistake, don't know how to remove that, sorry.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merging #12522 (086c5d1) into master (10e8ff9) will increase coverage by
0.62%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #12522 +/- ## ========================================== + Coverage 82.09% 82.71% +0.62% ========================================== Files 160 150 -10 Lines 193625 180512 -13113 Branches 43475 40571 -2904 ========================================== - Hits 158950 149315 -9635 + Misses 21835 18243 -3592 - Partials 12840 12954 +114
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | 82.71% <ø> (-0.03%) |
⬇️ |
| linux | 82.71% <ø> (-0.03%) |
⬇️ |
| mingw-x64-HUGE | ? |
|
| mingw-x86-HUGE | ? |
|
| windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
see 142 files with indirect coverage changes
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Wow, thank you very much for the feedback.
At my work, I needed this because we have distributed computing infra, for which can't easily modify the protocol but can provide a wrapper. I thought to use gdbserver, then Vim Termdebug to conntect to the gdbserver, but it turned out gdbserver + gdb "target remote" have some issues that I don't know how to resolve.
So now, I'm directly launching the gdb with the executable in Vim in the wrapper, then I don't need to deal with gdbserver anymore.
But anyway I think this "remote debug" mode can be useful, also for embedded debugging, then the "TermdebugRemote {host}:{port}" is the correct way to go.
Hope you don't mind, I will close this pull request, and work on "TermdebugRemote {host}:{port}" to send another pull request when it is ready for reviewing.
Thank you again.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #12522.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()