当前位置: 首页 > article >正文

vscode代码调试配置

C/C++代码调试

点击 vscode左侧的 run and debug,新建launch.json 和 tasks.json,并进行配置如下

launch.json

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

 

{

// 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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

 

{

"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"]

},

],

}


http://www.kler.cn/a/147188.html

相关文章:

  • STM32单片机设计防儿童人员误锁/滞留车内警报系统
  • 241113.学习日志——[CSDIY] [ByteDance] 后端训练营 [02]
  • 走进嵌入式开发世界
  • ARM(安谋) China处理器
  • GRE做题笔记(零散的个人经验)
  • Oracle Instant Client 23.5安装配置完整教程
  • 快速搭建一个SpringCloud、SpringBoot项目 || 项目搭建要点
  • Memory Management Examples
  • 【华为OD题库-039】乘坐保密电梯-java
  • Android Tombstone 与Debuggerd 原理浅谈
  • 如何解决React子组件中的逻辑很多影响父组件回显速度的问题
  • 【python程序】把小于10的数值都变成1
  • Gitee上传代码教程
  • Linux基本命令二
  • Compensated Summation/Kahan‘s Summation的理解
  • Python 基础【四】--数据类型-字符串【2023.11.23】
  • 距离向量路由协议——RIP
  • 深入理解OS--数值编码
  • 测试用例的设计思路
  • 【开源】基于Vue+SpringBoot的企业项目合同信息系统
  • Binlog vs. Redo Log:数据库日志的较劲【高级】
  • AI 绘画 | Stable Diffusion 提示词扩展插件
  • 静态方法和属性的经典使用-单例设计模式
  • 华为云CDN刷新与查询余量的Go实现及在Jenkins中的部署
  • redis—— 渐进式遍历
  • Java[list/set]通用遍历方法之Iterator