'How can I call arm-none-eabi-gdb with -x parameter

I want to call arm-none-eabi-gdb with -x parameter when launch debugger after installing cortex-debug. How can I do in launch.json or setting.json, thanks for your help.



Solution 1:[1]

You may try adding the following task to our tasks.json the following:

 {
        "label": "flash",
        "type": "shell",
        "command": "arm-none-eabi-gdb",
        "args": [               
            "-x=\"${workspaceFolder}/.vscode/flash.gdb\"",                
        ],
        "group": "build",
        "problemMatcher": [],
        "dependsOn":["build"]
    },

(of course this assume you have another task called "build" and that your "flash" task depends on it. this is just an example of how to add the -x argument)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marco Ramirez Castro