zoukankan      html  css  js  c++  java
  • mac 系统使用vscode 创建c/c++ 工程项目 并配置断点调试

    mac 使用vsCode 创建c/c++ 工程项目 并配置断点调试

    使用vscode 创建c/c++工程项目

    准备工作

    • 使用 vscode 下载插件 C/C++ Project Generator

    开始

    一、使用快捷键

    shift + command + p (mac) 
    ctrl + shift + p (win)
    

    二、输入并选择

    Create c project # 创建c工程
    Create c++ project # 创建c++ 工程
    


    三、目录如下


    配置断点调试

    准备工作

    • 下载插件 CodeLLDB

    • 配置.vscode 里面的 launch.json 、tasks.json

    launch.json 复制下面即可

    {
        "version": "0.2.0",
        "configurations": [
            {
                "type": "lldb",
                "request": "launch",
                "name": "Debug",
                "program": "${workspaceFolder}/output/main",
                "args": [],
                "cwd": "${workspaceFolder}",
                "preLaunchTask": "Build with Clang"
            }
        ]
    }
    

    tasks.json 复制下面即可

    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "Build with Clang",
                "type": "shell",
                "command": "clang++",
                "args": [
                    "-std=c++17",
                    "-stdlib=libc++",
                    "${fileBasenameNoExtension}.cpp",
                    "-o",
                    "${fileBasenameNoExtension}",
                    "--debug"
                ],
                "group": {
                    "kind": "build",
                    "isDefault": true
                }
            }
        ]
    }
    

    注意事项

    • 每次修改源文件必须重新编译(不然断点不是修改后的内容)

    断点调试查看资料

  • 相关阅读:
    wpf Behavior
    wpf Trigger
    语法糖
    Lambda 表达式
    wpf 3D动画
    IEnumerable接口学习
    Delegates, Events, and Anonymous Methods 委托、事件与匿名方法
    wpf 平滑效果随记
    软件工程第一篇博客
    记考研高数第一课
  • 原文地址:https://www.cnblogs.com/sjie/p/15671843.html
Copyright © 2011-2022 走看看