runtime(termdebug): Fix various Termdebug issues (vim/vim#12875)
* Fix some Termdebug issues after vim/vim#12403
* Fix :Asm in Termdebug prompt mode
* Fix Termdebug s:DecodeMessage escaping logic
a76f3221cd
Adjust disassembly message forwarding for Nvim, as its callback can receive
many lines at once.
Currently, just forward each disassembly line individually to s:CommOutput();
it's possible to do this in batch instead, but this is simpler.
I suggested moving to a GDB MI-based approach for the disassemble stuff
upstream, which should simplify the logic a lot if implemented (and possibly
allow for getting rid of the `&"disassemble ...` special-casing).
Also, correct "(gdb)" to include a trailing space; the stray GDB prompts were
being ignored by s:CommOutput() anyway, so this had caused no ill effects.
Vim splits lines on "\r", then trims any prefixed "\n".
But in Nvim, job output lines are split on "\n" (like readfile() in binary
mode), so trim any suffixed "\r" instead.
This gets rid of the trailing "^M" character in messages parsed from the jobs.
runtime(termdebug): refactor error printing (vim/vim#12856)
// vs not act like exception from vim or termdebug
f6fb52b667
Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
Runtime(termdebug): Add support to view local and argument variables
closes: 12403
9f29621415
Rename the existing "s:running" (#16790) to "s:gdb_running" to not clash with
the "s:running" introduced in this patch (which instead relates to whether the
debugged program is currently running in gdb).
Keep the file `:retab`bed as before.
Co-authored-by: laburnumT <flo.striker@gmail.com>
Problem: Termdebug: error with more than 99 breakpoints.
Solution: Use a different sign for breakpoint 100 and over. (closesvim/vim#12589,
closesvim/vim#12588)
e7d9ca2b3b
Co-authored-by: skywind3000 <skywind3000@163.com>
Problem: Termdebug on MS-Windows: some file names are not recognized.
Solution: Do not always change \t and \n. (Christian Brabandt,
closesvim/vim#12565, closesvim/vim#12560, closesvim/vim#12550)
c9a4a8ab28
Co-authored-by: Christian Brabandt <cb@256bit.org>
Vimball is an outdated feature that is rarely used these days. It is not
a maintenance burden on its own, but it is nonetheless dead weight and
something we'd need to tell users to ignore when they inevitably ask
what it is.
See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
Problem:
Job callbacks in termdebug cannot handle partial lines.
Solution:
Add a wrapper function that handles partial lines and only passes full
lines to the real callback.
Fix#22929.
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly
Problem: mapset() does not restore <Nop> mapping properly.
Solution: Use an empty string for <Nop>. (closesvim/vim#11022)
92a3d20682
Problem: The terminal debugger can't set a breakpoint with the mouse.
Solution: Add popup menu entries.
71137fed4d
This ports missing popup menu code to termdebug plugin.
Despite the commit message, the code is copied from latest Vim.
WinBar code is commented out and WinBar docs is not ported.
Problem: The terminal debugger uses various global variables.
Solution: Add a dictionary to hold the terminal debugger preferences.
c9a431c763
Omit popup menu.
s:EndTermDebug should only be called when exiting if the debugger started
without error, otherwise the plugin breaks.
Vim handles this by using job_setoptions to set the on_exit callback to
s:EndTermDebug after startup succeeds. However, Nvim does not have such
functionality; instead; use s:starting to mimic this behaviour.
Also, introduce s:running to fix s:CheckGdbRunning; it did not work correctly
due to the "[Process exited X]" message keeping the job's channel alive (though
the stream is closed). This means nvim_get_chan_info cannot be used to check if
the debugger has exited, as it may still return a non-empty dict.