You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示
"type": "cppdbg", // 配置类型cppdbg对应cpptools提供的调试功能可以认为此处只能是cppdbg
"request": "launch", // 请求配置类型可以为launch启动或attach附加
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", // 将要进行调试的程序的路径
"args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可
"stopAtEntry": false, // 设为true时程序将暂停在程序入口处相当于在main上打断点
"externalConsole": false,
"cwd": "${fileDirname}\\", // 调试程序时的工作目录,此为工作区文件夹;改成${fileDirname}可变为文件所在目录
"environment": [], // 环境变量
"internalConsoleOptions": "neverOpen", // 如果不设为neverOpen调试时会跳到“调试控制台”选项卡你应该不需要对gdb手动输命令吧
"MIMode": "gdb", // 指定连接的调试器可以为gdb或lldb。但我没试过lldb
"miDebuggerPath": "gdb.exe", // 调试器路径Windows下后缀不能省略Linux下则不要
"setupCommands": [
{ // 模板自带好像可以更好地显示STL容器的内容具体作用自行Google
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "Compile" // 调试会话开始前执行的任务一般为编译程序。与tasks.json的label相对应
}
]
}