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

[DAP] Stepping messed up after restart request #2081

Open
foxt451 opened this issue Sep 16, 2024 · 2 comments
Open

[DAP] Stepping messed up after restart request #2081

foxt451 opened this issue Sep 16, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@foxt451
Copy link

foxt451 commented Sep 16, 2024

Describe the bug
Using neovim, debugging itself works all fine, unless I restart the session (using nvim-dap extension with require('dap').restart()). When I restart the session, it hits the first breakpoint and kind of detaches(?): i.e. I can click step over and it will just do nothing (although indicating that execution is not stopped at the breakpoint anymore). I have to click "terminate session" twice to see [Process terminated] in the terminal. I tried the same launch.json in vscode and restarting works fine

To Reproduce
Steps to reproduce the behavior:

  1. Have a file like test.js
const a = 1;
console.log(a);
const b = 2;
console.log(b);
  1. Add breakpoint to the second line
  2. Start the debugger with this config
      require("dap").adapters["pwa-node"] = {
        type = "server",
        host = "localhost",
        port = "${port}",
        executable = {
          command = "node",
          args = {
            vim.call("stdpath", "data") .. "/lazy/vscode-js-debug/out/src/dapDebugServer.js",
            "${port}",
          },
        }
      }

And launch config:

          {
            type = "pwa-node",
            name = "Node",
            request = "launch",
            program = "${file}",
            cwd = "${workspaceFolder}",
            console = "integratedTerminal",
          },
  1. Hit breakpoint, step over fine.
  2. Restart the session via dap.restart(), hit the breakpoint, click Step Over and observe session detaching...

Log File
Log from nvim-dap, includes: start the session, hitting breakpoint, stepping over, restarting, hitting breakpoint, stepping over, terminating, terminating again. loadedSource event and stackTrace commands removed as too lengthy

Version I built dapDebugServer from the latest commit

Additional context
Sorry if nvim-dap issue, but I use like the most basic config

@foxt451 foxt451 added the bug Issue identified by VS Code Team member as probable bug label Sep 16, 2024
@foxt451
Copy link
Author

foxt451 commented Sep 16, 2024

dap.log

@connor4312
Copy link
Member

Please add trace = true to your launch config and share the log file that you get from that (path will be written to the DA output.) That will contain CDP data as well which has more info about what's happening in the runtime.

@connor4312 connor4312 added the info-needed Issue requires more information from poster label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants
@connor4312 @foxt451 and others