【问题标题】:How to get output of program, when running vscode lldb debugger, on the integrated terminal?在集成终端上运行 vscode lldb 调试器时如何获取程序输出?
【发布时间】:2020-03-26 15:14:55
【问题描述】:

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

请注意,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】:

    不幸的是

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-30
      • 2020-01-29
      • 1970-01-01
      • 2020-12-06
      • 2015-02-12
      • 2019-02-05
      • 1970-01-01
      • 2020-07-11
      相关资源
      最近更新 更多