About :help termdebug-example

157 views
Skip to first unread message

Dominique Pellé

unread,
Mar 11, 2018, 5:14:18 AM3/11/18
to vim_dev
Hi

I wanted to try the new debug feature in Vim.
I followed the steps at :help termdebug-example.
which say:

=== BEGIN QUOTE ===
Example session ~
*termdebug-example*
Start in the Vim "src" directory and build Vim: >
% make
Start Vim: >
% ./vim
Load the termdebug plugin and start debugging Vim: >
:packadd termdebug
:Termdebug vim
You should now have three windows:
source - where you started, has a window toolbar with buttons
gdb - you can type gdb commands here
program - the executed program will use this window

You can use CTRL-W CTRL-W or the mouse to move focus between windows.
Put focus on the gdb window and type: >
break ex_help
run
Vim will start running in the program window. Put focus there and type: >
:help gui
Gdb will run into the ex_help breakpoint. The source window now shows the
ex_cmds.c file.
=== END QUOTE ===


When I typed ":help gui", Vim hit the breakpoint, but I do not see the
Vim source code, despite the help file saying "The source window now
shows the ex_cmds.c file."

Is this supposed to work now, or is the debug feature still under
development?

For me it did not work. I'm curious whether it works for others. I tried
it in xterm and in xfce4-terminal. I also tried it in gvim gtk3 GUI.
Vim was built with debug symbols.

Regards
Dominique

Bram Moolenaar

unread,
Mar 11, 2018, 10:08:09 AM3/11/18
to vim...@googlegroups.com, Dominique Pellé
It works fine for me. I did have some occasions where the source code
with the breakpoint wouldn't be displayed, but could not find out why.

> For me it did not work. I'm curious whether it works for others. I tried
> it in xterm and in xfce4-terminal. I also tried it in gvim gtk3 GUI.
> Vim was built with debug symbols.

Before it hits the breakpoint, you do see the window with the debug
WinBar? Otherwise it's empty.

What happens in the communication window? It's normally hidden, but you
can open it in a window. When running into the breakpoint it should
contain something like:

~"Breakpoint 1, ex_help (eap=0x7fffffffd500) at ex_cmds.c:6194\n"
~"6194\t{\n"
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000055555
55ed7d3",func="ex_help",args=[{name="eap",value="0x7fffffffd500"}],file="ex_cmds
.c",fullname="/home/user/vim/vim80/src/ex_cmds.c",line="6194"},thread-id="1",sto
pped-threads="all",core="2"

Are the file names correct here?


--
EXPERIENCE - experience is a wonderful thing. It enables you to
recognise a mistake when you make it again.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages