castwide / vscode-ruby-debug

A Ruby debugger.
https://marketplace.visualstudio.com/items?itemName=castwide.ruby-debug
Other
28 stars 3 forks source link

Trying to debug minitest #16

Open tdegrunt opened 3 years ago

tdegrunt commented 3 years ago

Trying to debug a minitest, using the following configuration.

        {
            "type": "ruby-debug",
            "request": "launch",
            "name": "Debug current test",
            "program": "${workspaceFolder}/bin/rails",
            "programArgs": [
                "test",
                "${relativeFile}:${lineNumber}"
            ],
            "useBundler": false
        }

But basically nothing happens, I see rails starting in the debug console, but the process ends straight away without debugging. Am I doing something wrong? I see threads starting in the call stack. I have "break on raised exceptions" off, because otherwise I'd see all exceptions (caught or not).

Screen Shot 2021-07-13 at 08 36 05

Clicking on "Debug" here doesn't work, as that is tied to the ruby plugin.

I've tried useBundler: true, but that gives the same results.

Debugging using 'rails server', using the following configuration works:

        {
            "type": "ruby-debug",
            "request": "launch",
            "name": "Rails server",
            "program": "${workspaceFolder}/bin/rails",
            "programArgs": [
                "server"
            ],
            "useBundler": false
        }

It quickly ends in: "fatal (exception reentered):" though - in: /Users/tdegrunt/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4/lib/action_dispatch/middleware/static.rb:140

castwide commented 3 years ago

Does minitest work if you specify an explicit file and line, e.g., instead of "${relativeFile}:${lineNumber}" use "/path/to/test.rb:123"?

tdegrunt commented 3 years ago

That doesn't work, no. I've also tried without the line-number in the path, just to be sure, but same results. There's output in the debug console, which I always see (sadly - deprecation warnings).

castwide commented 3 years ago

This might be related to how the debugger's process monitor manages threads. I haven't identified a root cause yet, but I'm looking into it.

tdegrunt commented 3 years ago

If there's anything I can do, please let me know

jensljungblad commented 2 years ago

I have the same problem. I see two threads appear in the call stack, then disappear immediately. I don't see any output in the debug console though.

Any progress on this?