在集成终端上运行vscode lldb调试器时,如何获取程序的输出?



当我运行调试时,我的程序的输出不会显示在集成终端上。 这实际上在几天前就起作用了。我没有更改任何配置文件,但是,也许由于更新,这已经改变了。

请注意,lldb 没有"console"选项。

这也产生了一个主要问题,我无法为正在运行的程序提供输入。

这是我在集成终端中看到的:

[1] + Done    "/usr/bin/lldb-mi" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-871ntlpp.93i" 1>"/tmp/Microsoft-MIEngine-Out-msz8v24g.agq"

仅此而已。使用"externalConsole":true时情况相同。

如何将调试终端中当前的任何输出保留在其中,同时查看正常的程序输出并能够在集成终端中给出输入?

此外,这种行为让我思考,目前,拥有集成终端的意义何在?那里什么也没发生。

这是我的配置文件:

"version": "0.2.0",
"configurations": [
{
"name": "clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "clang++ build active file",
"miDebuggerPath": "/usr/bin/lldb-mi"
}
]
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]
不幸的是

https://code.visualstudio.com/docs/cpp/launch-json-reference

macOS:设置为 true 时,它将通过 lldb-mi 生成一个外部控制台。设置为 false 时,可以在 VS Code 的调试控制台中看到输出。由于 lldb-mi 中的限制,集成终端支持不可用

最新更新