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

Getting a default launch configuration #901

Closed
ashish-gawali-adi opened this issue Jun 22, 2023 · 0 comments
Closed

Getting a default launch configuration #901

ashish-gawali-adi opened this issue Jun 22, 2023 · 0 comments

Comments

@ashish-gawali-adi
Copy link
Contributor

The extension uses initialConfigurations to define a default configuration, this option has been deprecated as seen in this issue. It adds default configuration:

{
    "name": "Cortex Debug",
    "cwd": "${workspaceFolder}",
    "executable": "./bin/executable.elf",
    "request": "launch",
    "type": "cortex-debug",
    "runToEntryPoint": "main",
    "servertype": "jlink"
}

If you have an extension defining a new configuration of type: cortex-debug on creation launch.json, you have the default configuration defined in cortex-debug as well as the one defined in the extension sitting on top of cortex-debug, so you will have configurations in launch.json somewhat similar to the one below:

[
        {
            "name": "Cortex Debug",
            "cwd": "${workspaceFolder}",
            "executable": "./bin/executable.elf",
            "request": "launch",
            "type": "cortex-debug",
            "runToEntryPoint": "main",
            "servertype": "jlink"
        },
        {
            "name": "Debug configuration From new extension",
            "cwd": "${workspaceFolder}",
            "executable": "executable.elf",
            "request": "launch",
            "type": "cortex-debug",
            "runToEntryPoint": "main",
            "servertype": "openocd",
            "showDevDebugOutput": "both",
            "preLaunchCommands": [
                "set logging overwrite on",
                "set logging file debug-arm.log",
                "set logging on",
                "set remotetimeout 60",
                "tbreak abort",
                "tbreak _fatal_error",
                "tbreak _exit"
            ]
        },
]

The expected behavior would be to have just one configuration like below:

 [
       {
            "name": "Debug configuration From new extension",
            "cwd": "${workspaceFolder}",
            "executable": "executable.elf",
            "request": "launch",
            "type": "cortex-debug",
            "runToEntryPoint": "main",
            "servertype": "openocd",
            "showDevDebugOutput": "both",
            "preLaunchCommands": [
                "set logging overwrite on",
                "set logging file debug-arm.log",
                "set logging on",
                "set remotetimeout 60",
                "tbreak abort",
                "tbreak _fatal_error",
                "tbreak _exit"
            ]
        }
]

One possible to solution of this problem to remove initialConfigurations from package.json and implement function provideDebugConfigurations in file src\frontend\configprovider.ts.

  • Cortex-Debug Version: v1.12.0
  • OS: Windows 11
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

2 participants