VS Code: замена символов во встроенной переменной launch.json - PullRequest
0 голосов
/ 28 июня 2019

Я пытаюсь создать файл launch.json, в котором я хочу вызвать gdb. Только когда я это называю, кажется, что мне нужно использовать 4 обратных слеша в пути к файлам, чтобы заставить его работать. Поэтому я сейчас использую жестко запрограммированные пути, но я бы хотел использовать пути, полученные от cmake-tools.

{
    // 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": "gdb",
            "args": [],
            "externalConsole": true,
            "stopAtEntry": true,
            "windows": {
                "MIMode": "gdb",
                "cwd": "${workspaceRoot}",
                "miDebuggerPath": "${env:QNX_HOST}\\usr\\bin\\ntox86_64-gdb.exe",
                "miDebuggerServerAddress": "192.168.88.128:1234",
                "launchCompleteCommand": "exec-run",
                "customLaunchSetupCommands": [
                    {
                        "text": "-environment-cd ${workspaceRoot}"
                    },
                    {
                        "description": "Connecting to QNX pdebug",
                        "text": "target qnx 192.168.88.128:1234",
                        "ignoreFailures": false
                    },
                    {
                        "description": "Loading symbol table",
                        "text": "file ${command:cmake.launchTargetPath}", // this line is returning single backslashes and I want to replace them with four backslashes
                        "ignoreFailures": false
                    },
                    {
                        "description": "Uploading",
                        "text": "upload THIS\\\\FOLDER\\\\STRUCTURE\\\\IS\\\\WORKING /SOMEWHERE/ON/QNX",
                        "ignoreFailures": false
                    }
                ]
            },
            "logging": {
                "engineLogging": true,
                "trace": true,
                "traceResponse": true
            },
            "targetArchitecture": "x86_64"
        }
    ]
}
...