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

Can't figure out how to set up debugger #61

Open
dbak-invn opened this issue Jul 10, 2020 · 1 comment
Open

Can't figure out how to set up debugger #61

dbak-invn opened this issue Jul 10, 2020 · 1 comment
Labels
question Further information is requested

Comments

@dbak-invn
Copy link

Hi,

I can't figure out how to set up the debugger, the README is pretty unclear (at least for somebody unfamiliar with ceedling).

I copy/pasted the following into my settings file, but I am still getting the same error:

{
    "name": "Ceedling Test Explorer Debug",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceFolder}/build/test/out/${command:ceedlingExplorer.debugTestExecutable}",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "miDebuggerPath": "C:/MinGW/bin/gdb.exe",
    "setupCommands": [
        {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        }
    ]
}

Is there a part of this that I need to fill in, or something? I don't know what a debug configuration is, or how to specify them.

@luis-possatti
Copy link

luis-possatti commented Aug 17, 2020

Hi @dbak-invn

I have the same problem understanding this section of README, it is not quite clear. I will show how I could make it work in my case:

  1. Click in "Run->Add Configuration"
    • This step will guide you to create a "launch.json" file in your .vscode folder. In my case, I choose in the predefined configurations the option "C++(GDB/LLDB). By doing this, the content of my "launch.json" was:
{
    // 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": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/path/to/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

  1. I used the file that was generated in the step below as a template and inserted the suggested code of the documentation as another element of the configurations array, like below. I my case, I need to make a few modifications in the configuration code provided in extension's the documentation, to point to the correct path of gdb in my computer.
{
    // 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": [
        {
            // object generated in the previous step
        },

        {
            "name": "Ceedling Test Explorer Debug",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/test/out/${command:ceedlingExplorer.debugTestExecutable}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/cygwin64/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}
  1. The object I've inserted in the launch's configuration array has a field called name and its value is Ceedling Test Explorer Debug. You should open the Ceedling Test Explorer settings' page and point to this value in the Debugging Configuration field, like in the image below:

image

I hope you can make it works.

Luis

@numaru numaru added the question Further information is requested label Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants