linux下visual studio code中gdb调试文件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": "sf_car", // 配置名称,将会在启动配置的下拉菜单中显示
  "type": "cppdbg", // ++
   "request": "launch",
  "program": "${workspaceFolder}/src/out/car.cgi", // 调试程序的位置及程序名称
"args": [ // 传送进来的参数,像C函数中的argc个的args
    "oper"
],
   "stopAtEntry": false, // 设为true时程序将暂停在程序入口处, false时停在断点处
   "cwd": "${workspaceFolder}", // 调试程序时的工作目录
  "environment": [],
   "externalConsole": false, // 调试时是否显示控制台窗口,一般设置为true显示控制台
  "MIMode": "gdb",  // 指定连接的调试器,可以为gdb或lldb。
  "setupCommands": [
    {
       "description": "Enable pretty-printing for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
    }
  ],
  "preLaunchTask": "build", // 调试会话开始前执行的任务,一般为编译程序
  "miDebuggerPath": "/usr/bin/gdb"
  }
]
}
 
执行 start debug命令后,可以看到,程序调试窗口多了"sf_car"的运行项目。

猜你喜欢

转载自www.cnblogs.com/rohens-hbg/p/12703296.html