加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux 配置vscode

发布时间:2020-12-13 23:49:26 所属栏目:Linux 来源:网络整理
导读:launch.json 1 { 2 " version " : " 0.2.0 " , 3 " configurations " : [ 4 { 5 " name " : " (gdb) Launch " , // 配置名称,将会在启动配置的下拉菜单中显示 6 " type " : " cppdbg " , // 配置类型,这里只能为cppdbg 7 " request " : " launch " , // 请

launch.json

 1 {
 2     "version": "0.2.0", 3     "configurations": [
 4         {
 5             "name": "(gdb) Launch",// 配置名称,将会在启动配置的下拉菜单中显示
 6             "type": "cppdbg",// 配置类型,这里只能为cppdbg
 7             "request": "launch",// 请求配置类型,可以为launch(启动)或attach(附加)
 8             "program": "${workspaceRoot}/${fileBasenameNoExtension}.o",// 将要进行调试的程序的路径
 9             "args": [],// 程序调试时传递给程序的命令行参数,一般设为空即可
10             "stopAtEntry": false,// 设为true时程序将暂停在程序入口处,一般设置为false
11             "cwd": "${workspaceRoot}",// 调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录
12             "environment": [],13             "externalConsole": true,// 调试时是否显示控制台窗口,一般设置为true显示控制台
14             "MIMode": "gdb",15             "preLaunchTask": "g++",// 调试会话开始前执行的任务,一般为编译程序,c++为g++,c为gcc
16             "setupCommands": [
17                 {
18                     "description": "Enable pretty-printing for gdb",19                     "text": "-enable-pretty-printing",20                     "ignoreFailures": true
21                 }
22             ]
23         }
24     ]
25 }

tasks.json

 1 // https://code.visualstudio.com/docs/editor/tasks
 2 {
 3     "version": "2.0.0", 4     "command": "g++", 5     "args": ["-g","${file}","-o","${fileBasenameNoExtension}.o","-std=c++17"],// 编译命令参数
 6     "problemMatcher": {
 7         "owner": "cpp", 8         "fileLocation": ["relative","${workspaceRoot}"], 9         "pattern": {
10             "regexp": "^(.*):(d+):(d+):s+(warning|error):s+(.*)$",11             "file": 1,12             "line": 2,13             "column": 3,14             "severity": 4,15             "message": 5
16         }
17     }
18 }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读