Problem: Termdebug: still get E1023 when specifying arguments and using
a prompt buffer.
Solution: Use empty() instead of len(). Add a test. Fix wrong order of
arguments to assert_equal() in Test_termdebug_basic().
(zeertzjq)
closes: vim/vim#15288aef6179bcf
Fix a few minor issues:
1. filename with whitespaces issue should be fixed now, fixes: vim/vim#12357
2. ":Termdebug args" should work now, fixes: vim/vim#15254closes: vim/vim#15261c3837a46ff
Omit the DeleteCommands() change as it isn't really an improvement.
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Problem: termdebug can be further improved
Solution: refactor save/restore, update docs,
add a new save/restore test (Ubaldo Tiberi)
closes: vim/vim#15032a48637c105
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Problem: termdebug plugin needs more love
Solution: start with some more Vim9 refactoring
to improve maintenance and readability
(Ubaldo Tiberi)
List of Changes and the Reasoning Behind Them:
1) Introduction of InitScriptVariables() Function:
Reasoning: This function has been introduced to ensure that when you open and
close Termdebug, and then open it again, there are no leftover script variable
values from the previous session. Leftover values could potentially cause
issues. The goal is for each Termdebug session to be independent of previous
sessions. At startup, all script variables are initialized. The only exception
is g:termdebug_loaded located at the very beginning of the script to prevent
sourcing the script twice. The variables are declared at script level and
defined in InitScriptVariables().
2) More Descriptive Variable Names:
Reasoning: The names of variables have been made more comprehensive. Almost
every Termdebug buffer now has a variable to indicate its name and another
variable to indicate its number, improving code readability and
maintainability. Due to the latest discussion around the &mousemodel option
save/restore mechanism, perhaps some other variables shall be prepended with
saved_.
3) Consistent Naming for GDB Terminal Buffers:
Reasoning: The name of the GDB terminal buffer now matches the name of the GDB
program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This
ensures clarity and consistency in identifying buffers.
4) Other minor improvements:
Moved EchoErr() on top, added another test, some refactoring, mainly changed
several 0 and 1 to true and false
closes: vim/vim#14980ef8eab86e2
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
runtime(termdebug): allow multibyte characters as breakpoint signs (vim/vim#14274)
Allow multibyte characters as termdebug signs using slice() function
d3c0ff5d5a
Co-authored-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
- The :Evaluate result window is not cleaned up when the cursor moves.
- This window is not focusable.
Solution:
Replace the old implementation from autozimu/LanguageClient-neovim with
vim.lsp.util.open_floating_preview and implement custom focusing logic.
Also remove g:termdebug_useFloatingHover option now that it's working
correctly.
runtime(termdebug): improve the breakpoint sign label (vim/vim#13525)
// related vim/vim#12589
// that should be the last chat (I) with Bram, r.i.p
2dd613f57b
Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
Problem: It is not easy to restore saved mappings.
Solution: Make mapset() accept a dict argument. (Ernie Rael, closesvim/vim#10295)
51d04d16f2
Co-authored-by: Ernie Rael <errael@raelity.com>
runtime(termdebug): more termdebug fixes and improvements (vim/vim#12892)
- Fix and attempt to simplify :Frame/:Up/:Down documentation.
- Accept a count instead for :Up/:Down/+/-.
- Update the "Last Change" dates.
- Fix a missing :let (caused an error if gdb fails to start).
- Wipe the prompt buffer when ending prompt mode (if it exists and wasn't wiped
by the user first). Avoids issues with stale prompt buffers (such as E95 when
starting a new prompt mode session).
- Kill the gdb job if the prompt buffer is unloaded (similar to what's done for
a terminal buffer). Fixes not being able to start a new termdebug session if
the buffer was wiped by the user, for example.
3d3a9152fa
runtime(termdebug): add frame related commands (vim/vim#12511)
implementing `:Frame`, `:Up` and `:Down'
2ae7ffe0bc
Use maparg() for saving K as it's since been ported (and supports Lua callbacks
and the other API fields).
Use the 3 argument variant of mapset(), as the single argument one isn't ported
yet (v8.2.4861).
Co-authored-by: Simon Sobisch <simonsobisch@web.de>
Unlike Vim's job_stop(), Nvim's jobstop() does not take a signal argument, and
always sends SIGTERM/KILL.
:Stop and Ctrl-C in prompt mode is supposed to interrupt the program like in
terminal mode, not kill GDB.
Also, maybe libuv's kill() works on Windows? If so, the logic above could be
removed, but I don't have a Windows machine available to test that.
Also "set nomodified" when ending prompt mode, like Vim (avoids E37).
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.