老师好,我的VScode写完代码进行debug的时候自动生成的launch,json文件里面program那一行内容里会出现build\\Debug\\outDebug,然后导致debug出错,而且修改了路径变成.exe文件之后debug出现问题,基本完成不了debug了,这种情况怎么解决呢?
You have no rights to post comments
Comments
1,打开launch.json,在"miDebuggerPath"项中更新gdb.exe的目录。
这个设置了吗?
它现在报错的提示一直是'……\\buile \\Debug\\outDebug' does not exist
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}", //"${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev 0\\mingw32\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
也就是
1,先设置断点
2,编译
3,debug
但是,断点设置不对,或者,debug时,按键没按对。
不要点击run,而是by step。