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

Connection refused: OpenDebugAD7 --server --pauseForDebugger [WSL2] how to debug? #1478

Open
borjamunozf opened this issue Oct 2, 2024 · 1 comment

Comments

@borjamunozf
Copy link

borjamunozf commented Oct 2, 2024

Hello.

I'm trying to debug the OpenDebugAD7.exe following the documentation available to gather more information about this extremely annoying performance issue reported in c++ tools extension

However, the attach it's failing when running this with Dotnet extension. I also tried running a GDB with target remote to see if it's able to connect.

  • Connection refused

Config:

{
    "configurations": [
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "debugServer": 4711
         }
    ]
}

Tested with different ports with same result.

Environment:

  • WSL Ubuntu 22.04

How I built:

dotnet build src/MIDebugEngine-Unix.sln

./PublishOpenDebugAD7.sh whatever

The thing case is that if I run without --pauseForDebugger, it seems that the port it's accesible and even got connection with GDB.

./OpenDebugAD7.exe --server 

imagen

Shouldn't start listening at least and wating for debugger in the port? Or I have misunderstood it?

Related, if I try to attach using the coreclr + OpenDebugAD7 --server --pauseForDebugger, it crashes:

Stopping due to fatal error: FileNotFoundException: Could not find file '/home/borjamf/MIEngine/bin/Debug/vscode/coreclr.ad7Engine.json'.

Could you guide me how to be able to debug this?
Thanks.

@borjamunozf borjamunozf changed the title Connection refused: OpenDebugAD7.exe --server --pauseForDebugger Connection refused: OpenDebugAD7 --server --pauseForDebugger [WSL2] how to debug? Oct 2, 2024
@borjamunozf
Copy link
Author

Ok, I was able to connect to the running PID of OpenDebugAD7. However, I think the pauseForDebugger option is not really clear...

Steps:

  1. Build extension c++ microsoft passing --server option to OpenDebugAD7
  2. Install it & reload.
  3. Create a file named coreclr.ad7Engine.json inside ~/.vscode-server/extensions/..cpp-tools-your-version/
  4. Start debugging C++ target
  5. In other VScode Window, launch this config WITHOUT debugServer. For some reason, setting debugServer complains about missing program field.
{
    "configurations": [
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "logging": {
                "diagnosticsLog": {"debugEngineAPITracing": "all", "debugRuntimeEventTracing": true, "startDebuggingTracing": true}
            },

            "justMyCode": false,
            "symbolOptions": {
                "searchPaths": [
                    "/home/borjamf/MIEngine/bin/Debug/vscode/linux-x64/"             
                ],
                "searchMicrosoftSymbolServer": false,
                "searchNuGetOrgSymbolServer": false
            }
         },
  1. Replace the /debugAdapters/bin folder in the C++ extension with the contents of the MIEngine build - Debug\vscode\linux-x64 and Debug\vscode.

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

1 participant