vscode代码调试配置
C/C++代码调试
点击 vscode左侧的 run and debug,新建launch.json 和 tasks.json,并进行配置如下
launch.json
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "(gdb) Launch","type": "cppdbg","request": "launch","program": "${workspaceFolder}/build/HelloWorld","args": [],"stopAtEntry": false,"cwd": "${fileDirname}","environment": [],"externalConsole": false,"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true},{"description": "Set Disassembly Flavor to Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true}],"preLaunchTask": "build","miDebuggerPath": "/home/sietium/rocm/gdb"}]}
tasks.json
{"version" : "2.0.0","tasks": [{"type": "shell","label": "mkdirbuild","command": "mkdir","options": {"cwd": "${workspaceFolder}"},"args": ["-p", "build"],},{"type": "shell","label": "cmake","command": "cmake","options": {"cwd": "${workspaceFolder}/build"},"args": ["-DCMAKE_BUILD_TYPE=Debug",".."],"dependsOn" : ["mkdirbuild"]},{"type": "shell","label": "make","group": {"kind": "build","isDefault": true},"command": "make","args": ["-j",],"options": {"cwd": "${workspaceFolder}/build"},"dependsOn" : ["cmake"]},{"label": "build","dependsOrder": "sequence","dependsOn" : ["cmake", "make"]},],}