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

问题描述 投票:0回答:1

运行调试程序时,程序的输出未显示在集成终端上。这实际上在几天前就可以使用。我还没有更改任何配置文件,但也许由于更新而已更改。

请注意,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"
    }
]
c++ linux visual-studio-code lldb vscode-debugger
1个回答
0
投票

不幸的是

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

macOS:设置为true时,它将通过lldb-mi产生一个外部控制台。设置为false时,可以在VS Code的debugConsole中看到输出。由于lldb-mi的限制,integratedTerminal support not available

© www.soinside.com 2019 - 2024. All rights reserved.