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
            }
        ]
        }
    ]
}
相关推荐
码匠许师傅4 小时前
【设计模式精讲】29.行为型模式总结与对比(Behavioral Patterns Summary)
c++·设计模式·uml
啦啦啦啦啦zzzz5 小时前
Logger的组装(c++20)
c++·算法·c++20
繁星蓝雨6 小时前
C++的设计与演进大纲(如何从C语言一步步成长为C++)
c语言·开发语言·c++·c++历史·c++演进
蒸蒸yyyyzwd7 小时前
机试学习笔记
c++·求职招聘
handler018 小时前
【Linux】线程与虚拟内存的底层世界
linux·运维·服务器·c++·线程·虚拟地址空间·共享内存
郝学胜-神的一滴8 小时前
C++11 工程级应用 09:告别无谓拷贝,解锁高性能移动语义
开发语言·数据结构·c++·vscode·软件工程·visual studio
hetao173383710 小时前
校内场-提高组 ZYZSC-S-Round 4
c++·算法
stellanke11 小时前
Linux网络编程实战2:TCP Socket 基础与实践
linux·网络·c++
蒸蒸yyyyzwd11 小时前
机试和Redis学习笔记
c++·笔记·面试
tdtsmt12 小时前
2026年SMT贴片加工选型指南:天地通电子推荐参考
c++