vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.42k stars 237 forks source link

Can't find codelldb.exe (but, it's right there) #1092

Open hhmmjjnn opened 2 months ago

hhmmjjnn commented 2 months ago

OS: Windows 11 VSCode version: VSCodium-1.88.0 CodeLLDB version: CodeLLDB-1.10.0 Compiler: zig-0.11.0 Debuggee: x86_64-windows-msvc

  1. Run command workbench.action.debug.start
  2. task build completes sucessfully
  3. target executable is spawned
  4. process paused on entry-point
  5. CodeLLDB complains it can't find codelldb.exe
  6. though codelldb.exe is right where you'd expect it to be
  7. running the very same command manually, in a CMD box, resumes the execution of the target process until it exits
$ \\vadimcn.vscode-lldb-1.10.0-universal\\adapter\\codelldb.exe terminal-agent --connect=62648
bash: \vadimcn.vscode-lldb-1.10.0-universal\adapter\codelldb.exe: No such file or directory

image

{
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "type": "lldb",
                "request": "launch",
                "name": "Debug",
                "program": "${workspaceFolder}/zig-out/bin/foo.exe",
                "args": [],
                "cwd": "${workspaceFolder}",
                "preLaunchTask": "build"
            }
        ]
    }
genusistimelord commented 2 months ago

I am getting this same issue on Windows with Visual Code 1.88.0 and codelldb 1.10.0

it might run randomly one moment then when you try it again it does things like this

andrew.wheeler@KZO-20-0001 MINGW64 ~/render_demo (main) $ ^C

andrew.wheeler@KZO-20-0001 MINGW64 ~/render_demo (main) $ odelldb.exe terminal-agent --connect=64940 bash: odelldb.exe: command not found

andrew.wheeler@KZO-20-0001 MINGW64 ~/render_demo (main)

hhmmjjnn commented 2 months ago

It happened to me again, today, but with a Rust project.

The weirdest thing is that it works on the first try, but not in the second.

Gotta run workbench.action.reloadWindow to have another shot.

image

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "args": [
                "--"
            ],
            "cargo": {
                "args": [
                    "build"
                ],
                "env": {}
            },
            "cwd": "${workspaceFolder}",
            "name": "lldb",
            "request": "launch",
            "type": "lldb"
        }
    ]
}
genusistimelord commented 2 months ago

the issue is happening to me every-time but I found a work around for it at least for my issue. If i close the Debug terminal and Codelldb terminal before running any program it will correctly work. If i leave them open it will error with

andrew.wheeler@KZO-20-0001 MINGW64 ~/render_demo (main)
$ odelldb.exe terminal-agent --connect=64940
bash: odelldb.exe: command not found

@vadimcn any ideas on this? maybe its due to a new Visual code update?

genusistimelord commented 1 month ago

for a quick update I found that ensuring I am using the Default PowerShell instead of another bash that the issue goes away. So setting Visual codes Bash to be PowerShell will fix the issue. just you lose the nice coloring and such that other bashes give you.

hhmmjjnn commented 1 month ago

I tried the workarounds that @genusistimelord suggested and both work.