Linux上使用vscode编译运行和调试C/C++
发布时间:2022-12-06 10:28:32 所属栏目:Linux 来源:
导读: tasks.json 指定编译文件
launch.json 使用gdb调试
ctrl+shift+p
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label":
launch.json 使用gdb调试
ctrl+shift+p
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label":
tasks.json 指定编译文件 launch.json 使用gdb调试 ctrl+shift+p tasks.json { "version": "2.0.0", "tasks": [ { "label": "default", "type": "shell", "command": "g++", "args": [ "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}", //importance ], "problemMatcher": { "owner": "cpp", "fileLocation": [ "relative", "${workspaceRoot}" ], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } }, "group": { "kind": "build", "isDefault": true } } ] } launch.json { "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}",//importance "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "gdb", "preLaunchTask": "default", // must specify task name(label in tasks.json) "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] } (编辑:开发网_新乡站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐