[vim/vim] [Feature Request] provide abstractions to allow alternative debugger hookups to use termdebug UX (Issue #11605)

41 views
Skip to first unread message

jinyius

unread,
Nov 23, 2022, 11:42:28 PM11/23/22
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
termdebug supports GDB/MI only. DAP exists.

Describe the solution you'd like
It would be great if the UX around termdebug could be reused for an ambitious plugin writer to support working with DAP debuggers.

Describe alternatives you've considered
vimspector and neovim's nvim-dap

Additional context
nope


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605@github.com>

Ben Jackson

unread,
Nov 24, 2022, 4:37:31 AM11/24/22
to vim/vim, Subscribed

Describe alternatives you've considered
vimspector and neovim's nvim-dap

Do they not count as "ambitious" enough ?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1326191161@github.com>

razamatan

unread,
Nov 24, 2022, 5:20:03 AM11/24/22
to vim/vim, Subscribed

vimL only, no lua or python3 requirement
________________________________
From: Ben Jackson ***@***.***>
Sent: Thursday, November 24, 2022 1:37 AM
To: vim/vim ***@***.***>
Cc: razamatan ***@***.***>; Manual ***@***.***>
Subject: Re: [vim/vim] [Feature Request] provide abstractions to allow alternative debugger hookups to use termdebug UX (Issue #11605)



Describe alternatives you've considered
vimspector and neovim's nvim-dap

Do they not count as "ambitious" enough ?


Reply to this email directly, view it on GitHub<https://github.com/vim/vim/issues/11605#issuecomment-1326191161>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAD53TZ77YLCFOQTHPAO4CLWJ4ZMJANCNFSM6AAAAAASJWGP74>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1326242536@github.com>

Bram Moolenaar

unread,
Nov 24, 2022, 6:14:17 AM11/24/22
to vim/vim, Subscribed

From the front page DAP looks like a good idea to support. Perhaps start with one debugger that supports it and try make it work with TermDebug? Then plan to expand to support more. I have no idea how much work this would be. I can see a protocol specification, but it doesn't say how the communication is implemented. Using JSON?
It does appear to be very MS-Windows specific, character units are UTF-16 (worst choice ever).


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1326305874@github.com>

Ben Jackson

unread,
Nov 24, 2022, 6:19:56 AM11/24/22
to vim/vim, Subscribed

I can see a protocol specification, but it doesn't say how the communication is implemented. Using JSON?

It uses something like JSON-RPC over stdio. https://microsoft.github.io/debug-adapter-protocol/overview#base-protocol
basically a length header followed by a json payload.

I have no idea how much work this would be.

It's not a small amount of work, in and of itself, but the ecosystem of debug adapters and foibles is a lot of ongoing maintenance. I have been working on vimspector https://github.com/puremourning/vimspector/ for 5 years now and it implements about, say 40% of the spec. Implementing disassembly was weeks of work (elapsed, spare time) on its own.

it's also worth noting there are a number of other DAP plugins for vim that are very good.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1326312260@github.com>

razamatan

unread,
Nov 27, 2022, 12:23:23 AM11/27/22
to vim/vim, Subscribed

yeah, i took a good look at vimspector (listed in original post as alternatives considered.. tyvm for it, btw), but sometimes i don't have access to a +python3 compiled vim readily. that got me looking around and land on termdebug as a built-in thing.

it would be great if the abstractions existed since vimspector could reuse the same windowing approach and command bindings. i'm not deep enough down the rabbit hole of how vimspector is implemented to appreciate how difficult it would be to make it work at the window/UX layer to interop with the termdebug abstractions (if such things existed). but that's the FR. not suggesting we put a competing DAP client out there, but allow existing DAP clients to use more of the built-in debug experience.

________________________________
From: Ben Jackson ***@***.***>
Sent: Thursday, November 24, 2022 3:19 AM

To: vim/vim ***@***.***>
Cc: razamatan ***@***.***>; Manual ***@***.***>
Subject: Re: [vim/vim] [Feature Request] provide abstractions to allow alternative debugger hookups to use termdebug UX (Issue #11605)


I can see a protocol specification, but it doesn't say how the communication is implemented. Using JSON?

It uses something like JSON-RPC over stdio. https://microsoft.github.io/debug-adapter-protocol/overview#base-protocol
basically a length header followed by a json payload.

I have no idea how much work this would be.

It's not a small amount of work, in and of itself, but the ecosystem of debug adapters and foibles is a lot of ongoing maintenance. I have been working on vimspector https://github.com/puremourning/vimspector/ for 5 years now and it implements about, say 40% of the spec. Implementing disassembly<https://github.com/puremourning/vimspector/#disassembly> was weeks of work (elapsed, spare time) on its own.


it's also worth noting there are a number of other DAP plugins for vim that are very good.


Reply to this email directly, view it on GitHub<https://github.com/vim/vim/issues/11605#issuecomment-1326312260>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAD53T7RKSQH53CYB6Q2CGTWJ5FMLANCNFSM6AAAAAASJWGP74>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1328174541@github.com>

kohnish

unread,
Jun 27, 2023, 6:31:51 PM6/27/23
to vim/vim, Subscribed

GDB has DAP support now. I'm curious if we can try to give an optional support from termdebug already.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/1610308159@github.com>

ubaldot

unread,
Jun 22, 2024, 8:21:23 AM6/22/24
to vim/vim, Subscribed

I also support this. Now that termdebug is in Vim9 it should be easier to update. As a first step I would try to separate the frontend to the backend (which now only include gdb). In that way the frontend would be always the same but the backend should be easy to switch i.e. it should be easier to add other debugger support like debugpy, lldb, etc. or for a possible DAP implementation entirely in Vim9.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/2184011998@github.com>

ubaldot

unread,
Aug 19, 2024, 6:15:41 AM8/19/24
to vim/vim, Subscribed

@jinyius Given that DAP is the main wish, could you edit the title such that such a desire is more explicit? In this way there would be higher chances that someone could pick it up. Or one could also consider a porting of nvim-dap to Vim9 if does not want to change Termdebug.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11605/2296210557@github.com>

Reply all
Reply to author
Forward
0 new messages