VS Code,GDB远程调试和Linux / Windows路径字符

时间:2019-05-09 12:05:08

标签: debugging visual-studio-code gdb remote-debugging openocd

我希望这个简单的问题。我将VS Code与在Windows上运行的C / C ++扩展一起使用,以通过在Linux上运行的OpenOCD远程调试ARM Cortex M0板。一切都非常好,只有一个例外:路径字符。

问题是${workspaceFolder}宏。由于VS Code在Windows上运行,因此似乎总是使用\作为路径定界符。请参阅下面的错误图片。显然,可以使用/对完整路径进行硬编码,但可以使launch.json与计算机高度相关。

有人知道如何重新映射路径字符吗?

TAIA。

launch.json供任何需要工作参考的人

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "logging": { "engineLogging": true },
            "program": "R:/src/embedded/mcuxpresso/ASCH5_LPC/flash/ASCH5_LPC.axf",
            "stopAtEntry": false,
            "miDebuggerPath": "r:/apps/gcc-arm/bin/arm-none-eabi-gdb.exe",
            "MIMode": "gdb",
            "targetArchitecture": "arm",
            "launchCompleteCommand": "exec-run",
            "setupCommands": [ 
                { "text": "-target-select remote 192.168.1.99:3333", "description": "connect to target", "ignoreFailures": false },
                { "text": "-file-exec-and-symbols R:/src/embedded/mcuxpresso/ASCH5_LPC/flash/ASCH5_LPC.axf", "description": "load file", "ignoreFailures": false}, // this works
                //{ "text": "-file-exec-and-symbols ${workspaceFolder}/flash/ASCH5_LPC.axf", "description": "load file", "ignoreFailures": false}, // this does not ...
                { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false },
                { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false },
                { "text": "-interpreter-exec console \"monitor arm semihosting enable\"", "ignoreFailures": false },
            ],
            "externalConsole": true,
            "cwd": "${workspaceFolder}"
            }
    ]
}

enter image description here

0 个答案:

没有答案