Home Explore Blog CI



neovim

8th chunk of `runtime/doc/terminal.txt`
00cfc6dbf5b4389b718a43b3884106c826e20270175658730000000100000bbc
 "disasm_window_height" entry can be used to set the window height: >vim
	let g:termdebug_config['disasm_window'] = 1
	let g:termdebug_config['disasm_window_height'] = 15
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_disasm_window = 15
Any value greater than 1 will set the Asm window height to that value.
If the current window has enough horizontal space, it will be vertically split
and the Asm window will be shown side by side with the source code window (and
the height option won't be used).

						*termdebug_variables_window*
If you want the Var window shown by default, set the "variables_window" flag
to 1.  The "variables_window_height" entry can be used to set the window
height: >vim
	let g:termdebug_config['variables_window'] = 1
	let g:termdebug_config['variables_window_height'] = 15
If there is no g:termdebug_config you can use: >vim
	let g:termdebug_variables_window = 15
Any value greater than 1 will set the Var window height to that value.
If the current window has enough horizontal space, it will be vertically split
and the Var window will be shown side by side with the source code window (and
the height options won't be used).


Communication ~
						*termdebug-communication*
There is another, hidden, buffer, which is used for Vim to communicate with
gdb.  The buffer name is "gdb communication".  Do not delete this buffer, it
will break the debugger.

Gdb has some weird behavior, the plugin does its best to work around that.
For example, after typing "continue" in the gdb window a CTRL-C can be used to
interrupt the running program.  But after using the MI command
"-exec-continue"  pressing CTRL-C does not interrupt.  Therefore you will see
"continue" being used for the `:Continue` command, instead of using the
communication channel.


GDB command ~
							*g:termdebugger*
To change the name of the gdb command, set "debugger" entry in
g:termdebug_config or the "g:termdebugger" variable before invoking
`:Termdebug`: >vim
	let g:termdebug_config['command'] = "mygdb"
If there is no g:termdebug_config you can use: >vim
	let g:termdebugger = "mygdb"

If the command needs an argument use a List: >vim
	let g:termdebug_config['command'] = ['rr', 'replay', '--']
If there is no g:termdebug_config you can use: >vim
	let g:termdebugger = ['rr', 'replay', '--']

If you are a mouse person, you can also define a mapping using your right
click to one of the terminal command like evaluate the variable under the
cursor: >vim
	nnoremap <RightMouse> :Evaluate<CR>
or set/unset a breakpoint: >vim
	nnoremap <RightMouse> :Break<CR>


Several arguments will be added to make gdb work well for the debugger.
If you want to modify them, add a function to filter the argument list: >vim
	let g:termdebug_config['command_filter'] = MyDebugFilter

If you do not want the arguments to be added, but you do need to set the
"pty", use a function to add the necessary arguments: >vim
	let g:termdebug_config['command_add_args'] = MyAddArguments
The function

Title: Termdebug Window Configuration, Communication, and GDB Command
Summary
This section describes how to configure the display of the Assembly (Asm) and Variables (Var) windows in Termdebug, including setting their default visibility and height. It also explains the hidden buffer used for Vim-GDB communication and the importance of not deleting it. Finally, it details how to change the GDB command used by Termdebug, including using a list for commands with arguments, and how to define mappings for mouse clicks to execute Termdebug commands.