Visual Studio Code - C++ Debugger 無法啟動
Visual Studio Code - C++ Debugger doesn't start
我使用Visual Studio代码在Linux上调试C++已经有一段时间了。
在一个示例项目中,我得到了以下launch.json
:
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
我已经成功编译并运行了main.c,所以调试应该可以正常工作。
当我启动调试器时,箭头下会出现一个蓝色的加载条,什么也没发生。在我的笔记本电脑上,使用完全相同的配置,加载条会在几秒钟后消失,调试器就会启动。
看看ps aux
,我可以看到两个新的过程:
mono.linux-x86_640
和命令/home/guyyst/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/mono.linux-x86_64 --config /home/guyyst/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/framework/config.linux /home/guyyst/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/bin/OpenDebugAD7.exe
命令
bash /home/guyyst/.vscode/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/OpenDebugAD7
的bash
在我的笔记本电脑上调试会产生相同的过程,但当调试真正开始时,它们就会消失。即使在关闭VSCode之后,我电脑上的两个进程仍然存在。当我第一次注意到这一点时,我已经从以前的尝试中运行了15多个副本。
所有这些昨天都很好,从那以后我不记得对我的配置做过任何更改。
我已经尝试过多次通过AUR版本visual-studio-code-bin
或开源包code
重新安装VSCode。
调试一些Python代码运行得很好。
事实证明,这就像将launch.json
中的externalConsole
设置为false
一样简单。可能以前应该考虑过尝试一下。
我只能使用VSCode控制台,这没什么大不了的。
我仍然无法解释为什么它不能与外部控制台一起工作,因为这就是我现在在笔记本电脑上和过去在电脑上都能做到的。
- Visual Studio Code - C++ Debugger 無法啟動
- Qt Debugger在Mac上使用错误的python版本
- "Time Travel Debugger"的原理是什么?
- Visual C++-检测程序是否已加载到Visual Debugger中
- Qt 5.4 中的"No debugger set up"
- Visual Studio debugger语言 - 源搜索目录
- Visual Studio debugger 無法工作
- Debugging Boost.Test in Eclipse:debugger 不会在断点处停止
- Visual Studio中可能"break the debugger"什么(也许是std::string?)
- ni/src/SDL/debugger.cpp:1283:13:错误:"int i"之前在此处声明 eclipse
- Diffrent behaviour-VisualStudio Debugger against running exe
- "Attach to Process"而不是"Local Windows Debugger"
- Visual Studio Debugger:查看 std::list(和其他 std 容器)
- Visual Studio C++ -> Local Windows Debugger
- Monodevelop 5.9 (GNU Debugger?)