launch.json 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. {
  2. // 使用 IntelliSense 了解相关属性。
  3. // 悬停以查看现有属性的描述。
  4. // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
  5. "version": "0.2.0",
  6. "configurations": [
  7. {
  8. "name": "(gdb) Launch",
  9. "type": "cppdbg",
  10. "request": "launch",
  11. "program": "${workspaceRoot}/out/${fileBasenameNoExtension}",
  12. // 此处若可执行文件不想放在一个文件夹中,则把 /out 删去即可
  13. "args": [],
  14. "stopAtEntry": false,
  15. "cwd": "${workspaceRoot}",
  16. // 此处${workspaceRoot}与${workspaceFolder}应该类似,但网上资料大部分用的前者
  17. "environment": [],
  18. "externalConsole": false,
  19. "MIMode": "gdb",
  20. "setupCommands": [
  21. {
  22. "description": "Enable pretty-printing for gdb",
  23. "text": "-enable-pretty-printing",
  24. "ignoreFailures": true
  25. }
  26. ],
  27. "preLaunchTask": "C/C++: g++ build active file",
  28. // 此处要与tasks.json中的label相同
  29. "miDebuggerPath": "/usr/bin/gdb"
  30. }
  31. ]
  32. }