vscode 远程debug 调试linux上的makefile工程步骤

2022/2/8 7:16:06

本文主要是介绍vscode 远程debug 调试linux上的makefile工程步骤,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

分为两步

1 扩展

很多扩展都需要提前安装
比如
c/c++
比较重要的是makefile tools

2 debug

点击debug按钮,打开launch.json,基本上只需要修改program的名字就行。

3 launch.json和settings.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": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/utcsh",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

settings.json

{
    "makefile.extensionOutputFolder": "./.vscode"
}


这篇关于vscode 远程debug 调试linux上的makefile工程步骤的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程