当前位置: 主页 > 程序 >

基于VSCode调试C/C++程序

时间:2024-09-18  作者:haden   点击:
【摘要】# 1.WindowsTODO# 2.Linux```{ // 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", "co

1.Windows

TODO

2.Linux

{
    // 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": "/home/file",                                 //可执行文件完整路径
            "args": [],
            "stopAtEntry": true,                                     //是否在main函数处暂停
            "cwd": "${workspaceFolder}",                             //当前目录
            "environment": [{                                        //环境变量设置
                "name": "SRAM_START_ADDR",
                "value": "0xcf500000"
            }],
            "externalConsole": false,                                //是否在外部终端执行而不是在vscode控制台中
            "MIMode": "gdb",                                         //用gdb来debug
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            //"preLaunchTask": "C/C++: gcc build active file",        //在执行debug前,预先执行的任务
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}
顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片

推荐内容