首页 > 其他分享 >vscode launch&attach及常用插件使用必备指南

vscode launch&attach及常用插件使用必备指南

时间:2023-04-08 23:22:36浏览次数:39  
标签:gcc lightdb launch vscode 插件 fileDirname attach type cwd

.vscode下创建文件launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "attach lightdb process",
            "type": "cppdbg",
            "request": "attach",
            "name": "attach",
            "program": "/home/zjh/stage/lightdb-x/bin/lightdb",
            "processId": "${command:pickProcess}",
            "cwd": "${workspaceFolder}"
        },
        {
            "name": "start lightdb master",
            "type": "cppdbg",
            "request": "launch",
            "program": "/home/zjh/stage/lightdb-x/bin/lightdb",
            "args": ["-D","stage/lightdb-x/test_incre"],
            "stopAtEntry": false,
            "cwd": "/home/zjh",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description":  "将反汇编风格设置为 Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo helloworld",
            "type": "shell",
            "command": "echo aaa",
            "problemMatcher": [],
            "group": "test"
        },
        {
            "type": "shell",
            "label": "gcc default",
            "command": "gcc",
            "args": [
                "-I${workspaceFolder}/src/include",
                "${file}",
                "-g", // -g 生成调试信息,不然 无法使用断点
                "-o",
                
                "${fileDirname}/${fileBasenameNoExtension}.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        },
        {
            "type": "shell",
            "label": "gcc",
            "command": "gcc",
            "args": [
                "-I${workspaceFolder}/src/include",
                "${file}",
                "-g", // -g 生成调试信息,不然 无法使用断点
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        },
        {
            "type": "shell",
            "label": "g++",
            "command": "g++",
            "args": [
                "-I${workspaceFolder}/src/include",
                "${file}",
                "-g", // -g 生成调试信息,不然 无法使用断点
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ]
}

上述已经同时包含launch和attach。

标签:gcc,lightdb,launch,vscode,插件,fileDirname,attach,type,cwd
From: https://www.cnblogs.com/lightdb/p/17299551.html

相关文章

  • vscode 开发 vue3项目 , src 别名 为 @ ,报错
    https://geekdaxue.co/read/me-note@vue/mydm8l需要设置basicURL然后就生效了{"compilerOptions":{//设置解析非相对模块名称的基本目录"baseUrl":".",//设置模块名到基于baseUrl的路径映射,可以设置路径别名的语法提示"paths":{"@/*......
  • 『0002』 - Atom编辑器编写智能合约(Smart Contract)插件安装配置
    作者:黎跃春,编辑器选择理论上讲任何编辑器都可以编写Solidity合约代码,比如:WebStorm,VSCode,Sublime,等等。我选择的是Atom,没有任何理由,因为Atom轻量并且界面漂亮。移步https://atom.io/地址,下载安装Atom。autocomplete-solidity代码自动补齐linter-solium、linter-solidity代码错误检查......
  • 如何在终端中打开vscode
    在vscode中使用命令command+shift+P输入shell命令,选择Shell命令:在PATH中安装“code”命令,回车使用command+空格快捷键打开聚焦搜索,输入终端后打开终端切换到想要打开的文件目录下,在终端中输入code.命令即可在vscode打开当前文件文件路径的可通过将文件拖拽到终......
  • IDEA-常用设置及好用插件记录
    1、常用设置设置开启选择工作空间 设置工作空间编码集    2、好用插件......
  • VSCode插件 : ESLint Prettier Vite
    #创建项目pnpmcreatevitevite-eslint--templatevuecdvite-eslintpnpminstallpnpmrundev#安装插件pnpmiprettier-D#创建配置文件echo{}>.prettierrc.json#安装ESLintpnpmieslinteslint-plugin-vue-D#安装eslint-config-prettierpnpm......
  • Dart+VSCODE 安装
    DartforWindows(gekorm.com)  下载后执行安装器  安装后重启动计算机run--dart--version看到如下信息表示DART安装成功  VSCODE插件安装1、DART2CODERUNNER     HELLOWORLD  ......
  • VsCode中出现红色波浪线
    很奇怪的一天中,VsCode中突然出现了很多红色波浪线,然后上网查了查,发现是Pylance的问题,那就想办法解决了,比如下面的问题:要做的呢?就是打开VsCode中的设置:然后就是打开settings.json文件,如下图:打开之后,就可以借鉴这篇博文的内容了,https://blog.csdn.net/CassieZh/articl......
  • Tomcat的Maven插件
    <build><plugins><plugin><!--tomcat插件--><groupId>ch.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</art......
  • 《渗透测试》安全开发-PHP应用&留言板功能&超全局变量&数据库操作&第三方插件引用 202
    PHPStorm:专业PHP开发IDEPhpStudy:ApacheMYSQL环境NavicatPremium:全能数据库管理工具 #数据导入-mysql架构&库表列1、数据库名,数据库表名,数据库列名2、数据库数据,格式类型,长度,键等 #数据库操作-mysqli函数&增删改查PHP函数:连接,选择,执行,结果,关闭等参考:https://......
  • VScode美化
    RESULT:EVA-初号机配色主题效果1.需要的东西vscodebackground插件customCSSandJSloader插件一些png素材,推荐网址:https://www.vhv.rs/https://anime-pictures.net/EVAUnit-1ThemeV2主题插件2.安装步骤安装vscode安装插件和主题下载好相应的png......