首页 > 解决方案 > 在 VSCode - C 中将 coreDumpPath 添加到 launch.json

问题描述

我的launch.json文件如下:

{
    // 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": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb",
            "coreDumpPath": "${fileDirname}/${fileBasenameNoExtension}"
        }
    ]
}

我启动调试器时的问题是:

Unable to start debugging. Unexpected GDB output from command "-target-select core /../../../C/helloWorld". "/../../../C/helloWorld is not a core dump: file format not recognised."

我在网上搜索了一个解决方案,但我不知道核心转储文件的正确文件格式是什么。

标签: cdebuggingvisual-studio-codevscode-debugger

解决方案


推荐阅读