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

Unable to start debugging. The value of miDebuggerPath is invalid problem #692

Closed
ZlodejS opened this issue May 20, 2019 · 9 comments
Closed

Comments

@ZlodejS
Copy link

ZlodejS commented May 20, 2019

Hello, i'm new at coding and normaly i code websites and things like this, i get try to code one program is my long therm project in C++ so i try my best,

now i just testing how to do data base with all things inside and to open everything but in debugging i have problem:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/main.cpp",
            "cwd": "${workspaceFolder}",
            "args": [],
            "stopAtEntry": false,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "\\Sebastian\\Program\\gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true,
                }
            ]
        }
    ]
}

any idea.??

@pieandcakes
Copy link

@ZlodejS This seems like a C++ extension issue. From my quick look, your path to gdb is not a real path. Please locate your gdb path on your machine. On Linux it is at /usr/bin/gdb. If you want more support, please open an issue on the C++ extension issues page.

@bobbrow
Copy link
Member

bobbrow commented Jul 17, 2019

We've determined that this is not a bug in the CMake Tools extension.

@newyeo
Copy link

newyeo commented May 28, 2020

Hi, I encounter the same issue. That's

Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option.

Bug description:
Hit the green button at left it can debug successfully while hit the debug button at bottom it launch the Unable to start debugging and show the above error message.

  • Version: 1.45.1 (user setup)
    Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
    Date: 2020-05-14T08:27:35.169Z
    Electron: 7.2.4
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Windows_NT x64 10.0.15063

  • OS: win10 pro

  • List of extensions that have installed:
    c/c++ 0.28.1
    CMake 0.0.17
    CMake Tools 1.4.0
    Python 2020.5.80290

  • Reproducible steps (1... 2... 3...) that cause the issue
    Hit the debug button at bottom it launch the error above.

  • What you expected to see, versus what you actually saw
    Expect it enter the debug process.

  • Images, animations, or a link to a video showing the issue occurring
    image

  • A code snippet that demonstrates the issue or a link to a code repository the developers can easily pull down to recreate the issue locally
    launch.json

{
    // 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": [
        {
            "name": "g++.exe - 生成和调试活动文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "g++.exe build active file",
            "logging": {
                "trace": false,
                "traceResponse": false,
                "engineLogging": true
            }
        }
        
    ]
}

task.json

{
    "tasks": [
        {
            "type": "shell",
            "label": "g++.exe build active file",
            "command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\\mingw64\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\\mingw64\\bin"
            }
        }
    ],
    "version": "2.0.0"
}
  • Result from output after enabling the engineLogger:
    output.log

I checked. This debug button at buttom is appeared as CMake tool extension enabled and it disappeared after CMake tool is disabled. So it might be issues of CMakes tool.
And The path of miDebuggerPath does exist on my computer. I jump here from vscode-cpptools. For more details you can check the following link microsoft/vscode-cpptools#1006

@bobbrow
Copy link
Member

bobbrow commented Jun 4, 2020

To make the CMake Tools debug button pick up non-default settings like the ones you specified in launch.json, you have to set the cmake.debugConfig setting.

For example:

  "cmake.debugConfig": {
    "miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
  }

@newyeo
Copy link

newyeo commented Jun 9, 2020

I follow the offical tutorial to add the task.json and launch.json. And then add the cmake tool extension.
Do you the cmake tool has its own defaut configuration? I don't know its callable logic. I try to add the cmake.debugConfig to launch.json. It shows the error as shown below:
image
And I also try to delete the launch.json under .vscode folder and use ctrl + shift + p to command cmake: debug it shows the save error as mentioned above. It's unable to start debugging.

So how to launch cmake debug? Is there any tutorial or description? Thank you twice.

@andreeis
Copy link
Contributor

andreeis commented Jun 9, 2020

You have to define that setting in .vscode\settings.json. Let us know how that goes.

@newyeo
Copy link

newyeo commented Jun 9, 2020

@andreeis Thank you very much! /shakehands. It finally works after I add that confiture to setting.json.
The final setting.json is pasted below:

{
    "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
    "cmake.debugConfig":{
        "miDebuggerPath":"C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
    },
    "files.associations": {
        "array": "cpp",
        "atomic": "cpp",
        "*.tcc": "cpp",
        "cctype": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "deque": "cpp",
        "unordered_map": "cpp",
        "vector": "cpp",
        "exception": "cpp",
        "algorithm": "cpp",
        "memory": "cpp",
        "memory_resource": "cpp",
        "optional": "cpp",
        "string": "cpp",
        "string_view": "cpp",
        "system_error": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "utility": "cpp",
        "fstream": "cpp",
        "initializer_list": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "typeinfo": "cpp"
    },
    "C_Cpp.loggingLevel": "Debug"
}

@lattice0
Copy link

lattice0 commented Jul 4, 2020

On ubuntu bionic I had to do sudo apt install -y lldb then

            "miDebuggerPath": "/usr/bin/lldb-vscode-10"

I don't know why, and I didn't find any information about miDebuggerPath. What is it?

I tried

            "miDebuggerPath": "/usr/bin/lldb-10"

but it complains about some ignored options (--mi I guess)

@bobbrow
Copy link
Member

bobbrow commented Jul 6, 2020

The "MI" is a protocol that allows our debugger to communicate to various different debuggers in a uniform way. LLDB recently stopped distributing their lldb-mi binary and the Visual Studio debugger team is weighing options on what to do about that. We very recently unblocked macOS users on this problem, but now Linux users are catching up to the problem by using newer LLVM distributions. There is some discussion about the problem here: microsoft/vscode-cpptools#5415

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants