Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle disassemble request #331

Open
rebelot opened this issue Oct 8, 2021 · 12 comments
Open

Handle disassemble request #331

rebelot opened this issue Oct 8, 2021 · 12 comments

Comments

@rebelot
Copy link

rebelot commented Oct 8, 2021

Problem Statement

It would be great if one could see the disassembled code in a split window. Similarly to codelldb.

Ideas or possible solutions

No response

@rebelot

This comment was marked as outdated.

@mfussenegger

This comment was marked as resolved.

@rebelot

This comment was marked as outdated.

@rebelot

This comment was marked as outdated.

@mfussenegger

This comment was marked as outdated.

@puremourning
Copy link

puremourning commented Oct 23, 2022

See also vadimcn/vscode-lldb#627, looks like standard DAP conform disassembly request isn't supported yet in codelldb

Should be coming soon: vadimcn/codelldb#790. FWIW vscode-cpptools (MIEngine) already supports the DAP disassembly.

I also requested some clarifications because the DAP spec for disassembly is baffling:

I did this as part of implementing disassembly and instruction breakpoints for vimspector, which turned out to be a ton of work and the UI is still not ideal. Useful when needed, mostly not needed.

Hope this is useful info if/when you come to implement it :)

@mfussenegger
Copy link
Owner

Oh nice work. Thanks, this will be very helpful.

@ViRu-ThE-ViRuS
Copy link

the feat seems to be merged: vadimcn/codelldb#790
are there any plans to have this supported in nvim-dap?

@ColinKennedy
Copy link

I was curious if this would be hard to do so I gave it a shot.

disassembly_example.mp4

It's missing highlighting and doesn't perfectly fit the frame but the POC works. Because one could make a case that the disassembly output is dependent on the size of the window, I ended up placing the request directly in nvim-dap-ui rather than in nvim-dap. I could have done it in nvim-dap to request it any time the stack changes or step-{in,out,over} but it seemed like that wasn't the best thing to do because you'd have to assume the size of the request. Or maybe it would have made more sense to just keep requesting more instructions until DisassembledInstruction's line value goes past the current source code line. I'm curious what people think makes more sense. From what I can see vimspector's https://github.com/puremourning/vimspector/blob/831530b85aad02f2c465047a21452409bfaaf784/python3/vimspector/disassembly.py#L243-L249 incorporates window height into the request which further made me think nvim-dap-ui was the better place.

@puremourning
Copy link

Iirc Vimspector requests about 2 pages of instructions above and below the viewport and modifies that when the window is scrolled. It took some trial and error to tune this.

@0xwal
Copy link

0xwal commented Aug 3, 2024

We would love to see this feature.
I am trying to learn Dap protocol in my free time in order to work on this.

@ColinKennedy
Copy link

@0xwaleed Check out rcarriga/nvim-dap-ui#309. Specifically lua/dapui/components/disassembly.lua and its uses of client.session, client.request.disassemble, and the like. And of course https://github.com/puremourning/vimspector/blob/831530b85aad02f2c465047a21452409bfaaf784/python3/vimspector/disassembly.py#L243-L249, which is what I based it off of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants