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

step into assembly? [rust] #571

Open
smallstepman opened this issue Feb 24, 2022 · 3 comments
Open

step into assembly? [rust] #571

smallstepman opened this issue Feb 24, 2022 · 3 comments

Comments

@smallstepman
Copy link

while playing with vscode today, I discovered it's possible to step into assembly and jump around stack frames
screenshot-full-2022-02-24_18:39:42

vscode auto-generated the following config

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug executable 'cp-sandbox'",
            "cargo": {
                "args": [
                    "build",
                    "--bin=cp-sandbox",
                    "--package=cp-sandbox"
                ],
                "filter": {
                    "name": "cp-sandbox",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug unit tests in executable 'cp-sandbox'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--bin=cp-sandbox",
                    "--package=cp-sandbox"
                ],
                "filter": {
                    "name": "cp-sandbox",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]
}

I tried doing the same with GDB in dap-mode. Steping into does something in the background but it doesn't open an emacs buffer with asm code.

Is there a similar feature in dap-mode? Does it matter whether I use GDB or LLDB?

@smallstepman smallstepman changed the title step into assembly [rust] step into assembly? [rust] Feb 24, 2022
@yyoncho
Copy link
Member

yyoncho commented Feb 24, 2022

It is something that has to be implemented on our side, but definitely possible(unless it is a proprietary feature/debug adapter).

@smallstepman
Copy link
Author

smallstepman commented Feb 25, 2022

Interesting! I tried looking around for more info:
This is the extension I used: https://github.com/vadimcn/vscode-lldb
I believe this is the line responsible for the printing: https://github.com/vadimcn/vscode-lldb/blob/0ece78ec15eda432be7c9e4392aaec9404c29942/adapter/src/disassembly.rs#L233

@eshelyaron
Copy link
Contributor

There are a couple of features defined in the DAP specification that aren't implemented in dap-mode (yet), I also have discovered that disassembly is one of them while working on the SWI Prolog debug adapter server.

Basically if I understand correctly, dap-mode needs to implement the disassemble DAP request to fetch and display the instruction sequence, as well as add the granulatity field to the stepIn request, setting the granularity to instruction.

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

3 participants