]> git.ipfire.org Git - thirdparty/vim.git/commit
runtime(termdebug): Fix various Termdebug issues (#12875)
authorSean Dewar <seandewar@users.noreply.github.com>
Tue, 22 Aug 2023 18:30:29 +0000 (19:30 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Aug 2023 18:30:29 +0000 (19:30 +0100)
commita76f3221cdcfff6880213839de4d04cf0c7c60f8
treee2409c451a7d795e0f64fc844f5cd06f4a5f41f1
parentb0d584d97ab6f5cb070caba3882ba387b81448c1
runtime(termdebug): Fix various Termdebug issues (#12875)

* Fix some Termdebug issues after #12403

Problem: Cleanup for :Var and :Asm buffers did not apply to prompt mode, and
E86 was possible if they were hidden.
Solution: Move cleanup to s:EndDebugCommon. Check that the buffers exist before
switching.

* Fix :Asm in Termdebug prompt mode

Problem: :Asm does not work in prompt mode.
Solution: Make it work by handling disassembly-related messages properly.

The previous implementation depended on the typed or sent (via s:SendCommand())
"disassemble ..." message being visible to s:CommOutput(), but this was only
true for the terminal-based job.

A more robust solution would be to use GDB MI's -data-disassemble command. I may
implement this in a future PR.

* Fix Termdebug s:DecodeMessage escaping logic

Problem: Termdebug does not escape gdb messages properly.
Solution: Improve the logic. Do not mangle messages if they have inner escaped
quotes. Use line continuation comments properly.

Interestingly, due to the missing line continuation comments (`"\`), most of
these substitutions were ignored.

Presumably, this logic still isn't exact. For example, if a message ends in
`\\"`, the quote may be preserved, even though it's the `\` being escaped
(similar issues may exist for the other escapes). This may not be a problem in
practice, though.
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim