vscode调试C++程序

vscode调试C++的launch.json

json 复制代码
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debug llama",
            "type": "cppdbg",
            "request": "launch",
            "program": "/workspace/KuiperLLama/vscode_build/demo/llama_infer",
            "args": [
                "/workspace/KuiperLLama/models/stories110M.bin",
                "/workspace/KuiperLLama/models/tokenizer.model"
             ], // 可执行文件的命令行参数,如需要可添加
            "stopAtEntry": false, // 是否在main函数入口暂停
            "cwd": "/workspace/KuiperLLama", // 工作目录,根据需要调整
            "environment": [], // 环境变量,例如 [{"name": "LD_LIBRARY_PATH", "value": "/usr/local/lib"}]
            "externalConsole": false, // 设为 true 可打开外部终端(已废弃,推荐用 integratedTerminal)
            "console": "integratedTerminal", // 推荐:在 VS Code 内部终端中运行
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 SIGINT 等信号启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "将反汇编风格设为 Intel",
                    "text": "set disassembly-flavor intel",
                    "ignoreFailures": true
                },
                {
                    "text": "-enable-pretty-printing\nskip -gfi /usr/include/c++/*/*/*\nskip -gfi /usr/include/c++/*/*\nskip -gfi /usr/include/c++/*",
                    "ignoreFailures": true
                }
            ],
            "miDebuggerPath": "/usr/bin/gdb"
        },
        
        {
        "name": "Debug aaa",
        "type": "cppdbg",
        "request": "launch",

        "program": "/workspace/a_study/cpp/vscode_build/aaabbb",
        "args": [],
        "stopAtEntry": false,
        "cwd": "/workspace/a_study/cpp",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb",

        "setupCommands": [
            {
            "description": "Enable pretty-printing",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
            }
        ]
        }
    ]
}
相关推荐
clint4562 天前
C++进阶(1)——前景提要
c++
夜悊3 天前
C++代码示例:进制数简单生成工具
c++
郝学胜_神的一滴3 天前
CMake 021: IF 条件判据详诠
c++·cmake
_wyt0013 天前
洛谷 B3930 [GESP202312 五级] 烹饪问题 题解
c++·gesp
摇滚侠3 天前
IDEA 创建 Java 项目 手动整合 SSM 框架
java·ide·intellij-idea
玖玥拾3 天前
C/C++ 数据结构(七)栈、容器适配器
c语言·数据结构·c++··容器适配器
один but you3 天前
constexpr函数
c++
凡人叶枫3 天前
Effective C++ 条款41:了解隐式接口和编译期多态
java·开发语言·c++·effective c++
凡人叶枫3 天前
Effective C++ 条款42:了解 typename 的双重意义
java·linux·服务器·c++
霸道流氓气质3 天前
Trae IDE 新手入门指南
ide