Describe the bug
I get this error running vim 8.2 when starting :Termdebug:
Error detected while processing function 2_StartDebug[2]..2_StartDebug_internal[50]..2_StartDebug_term:
line 97:
Cannot check if your gdb works, continuing anyway
Press ENTER or type command to continue
After a few seconds GDB starts anyway.
To Reproduce
Detailed steps to reproduce the behavior:
Expected behavior
I think my GDB takes a few seconds to start, since it loads over NFS. Looks like the script has a timeout waiting for it. I get this error message every time. Either we can increase the time limit, add the ability to disable the check, or log the error in some way that's not so visible.
Environment (please complete the following information):
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
I have a similar problem, after running the Termdebug command I see:
Error detected while processing function <SNR>128_StartDebug[2]..<SNR>128_StartDebug_internal[45]..<SNR>128_StartDebug_term:
line 97:
Cannot check if your gdb works, continuing anyway
Press ENTER or type command to continue
Also for me increasing the limit doesn't seem to help.
I don't have NFS, everything is local, and this is on a very small sample program I'm using specifically for testing termdebug. My environment is a bit different:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 28 2021 17:26:13)
Included patches: 1-814
Modified by Gentoo-8.2.0814-r100
What I have found is that after the error occurs and I press ENTER to continue, the gdb window opens with my cursor at the end of the last line here:
new-ui mi /dev/pts/21
File /usr/include/gcc/**/*.h will be skipped when stepping.
Reading symbols from ./target/debug/sandbox-gdb...
(gdb) new-ui mi /dev/pts/21
If I now immediately press ENTER, I'll get a "New UI allocated" message, and everything will then work perfectly:
new-ui mi /dev/pts/21
File /usr/include/gcc/**/*.h will be skipped when stepping.
Reading symbols from ./target/debug/sandbox-gdb...
(gdb) new-ui mi /dev/pts/21
New UI allocated
(gdb)
If I don't press enter here, and instead clear the line, the GDB window will work fine but vim won't be able to trace the execution. The PC and Breakpoint highlights won't be shown and I won't be able to set :Break from the source view.
If I add sleep 200m after "Set arguments to be run" then it is enough to mask the race condition and everything works. I am attaching the debug log before any changes and a copy after the added sleep statement.
Where exactly did you put that sleep? I guess it is:
" Set arguments to be run. First wait a bit to make detecting gdb a bit
" more reliable.
sleep 200m
if len(proc_args)
call term_sendkeys(s:gdbbuf, 'set args ' . join(proc_args) . "\r")
endif
Yes, that is exactly what I did.
—
I was thinking that perhaps we could read the (gdb) prompt before sending commands, but one problem I anticipate with this is it would probably break if the prompt was customized. Another idea is to start gdb with an echo command, and then maybe we could try to read the text:
$ gdb -quiet --eval-command 'echo howdy\n'
File /usr/include/gcc/**/*.h will be skipped when stepping.
howdy
(gdb)
This made me wonder, could we just send all the setup commands as part of the gdb exec command? I haven't tried to get this working at all, but do you see any immediately obvious problems with it?
—
looks like this has been included as of d2ea7cf so closing
Closed #8163.