简体   繁体   中英

How to get output of program, when running vscode lldb debugger, on the integrated terminal?

When I run the debug, the output from my program isn't displayed on the integrated terminal. This actually used to work a few days ago. I haven't changed any config files and yet, perhaps due to an update, this has changed.

Note that there is no "console" option with lldb.

This also creates a major issue that I can't provide input to my running program.

This is what I see in the integrated terminal:

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

And that's it. The case is the same when using "externalConsole":true .

How do I keep whatever output is currently in the debug terminal inside it, but also see the normal program output and be able to give input in the integrated terminal?

Also, this behavior leads me to think, currently, what is even the point of having the integrated terminal? Nothing is happening there.

here are my config files:

"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"
    }
]

unfortunately

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

macOS: When set to true, it will spawn an external console through lldb-mi. When set to false, the output can be seen in VS Code's debugConsole. Due to limitations within lldb-mi, integratedTerminal support is not available .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM