Vscode-cpptools: waiting for v8 protocol on stdin/stdout

Created on 10 Aug 2018  Â·  7Comments  Â·  Source: microsoft/vscode-cpptools

Type: Debugger
Input information below

Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.

Describe the bug

  • OS and Version:

Ubuntu 16.04

  • VS Code Version:

1.25.1

  • C/C++ Extension Version:

0.17.7

  • Other extensions you installed (and if the issue persists after disabling them):

cmake tools 1.1.1

  • A clear and concise description of what the bug is.

Unable to 'cout' to the console.
instead there is this message in the extension console:
"waiting for v8 protocol on stdin/stdout"

I tried to google this message and find informations on the web, but maybe my knowledge is not enough.

Here is the main.cpp file from cmake : quick start

include

int main(int, char**) {
std::cout << "Hello, world!\n";
}

To Reproduce
Steps to reproduce the behavior:

Installed last version of cmake
installed last version of clang
installed last version of studio code
delete all studio code user settings
launch vscode studio
installed last version of plugin cpptools
installed last version of cmake tools
change user settings to the path of cmake
change user settings to the path of clang
restart vs code studio
create a new folder 'test'
palette: cmake : quick start with this settings : gcc 5.4, Executable, project title 'test'.
Press button to build
Press button to debug
Open extension console, the message "waiting for v8 protocol on stdin/stdout" is displayed, but no "Hello World" message.

debugger

All 7 comments

Can you share your launch.json?

I am not an expert, but I think there is no issue with lauch.json:
If my understanding is correct, there are two 'modes' between cmake plugin and cpp plugin for the debugger:
1/ An automatic mode : when I click the button 'debug' , the debugger is automatically launched, apparently without launch.json (and I didn't create a launch.Json during my new installation).

2/ A manual launch, for this, a new configuration is requested.
I tried the default launch.json, with only 1 change for "program" (see below), but the result is the same. I can change externalConsole to false as well , the result is the same.

In both configuration, manual or 'automatic' (with the debug button) There is the same error message, and no HelloWorld printed.

Here is the debug console display, it looks like everything is working well, but no HelloWorld

Breakpoint 1, main () at /home/christian/Documents/monrobot/testcmake6/src/main.cpp:4
4 std::cout << "Hello, world!\n";
[Inferior 1 (process 7452) exited normally]
The program '/home/christian/Documents/monrobot/testcmake6/build/testcmake6' has exited with code 0 (0x00000000).

and below the launch.json for this result:

{
// Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
// Pointez pour afficher la description des attributs existants.
// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

The output waiting for v8 protocol on stdin/stdout should only come if you launch the debugger executable directly. That is a string from our extension, however that means that it is not communicating with VSCode. I could not reproduce your issue on Ubuntu 16.04 VM.

We do not control the ${command:cmake.launchTargetPath} command, that is from the CMake extension. Can you change program to be your executable directly and see if you can debug with F5 from there?

Hi,
many thanks for your support,
I changed 'program' to my executable path. The change is the following:
it looks like cmake does not try to link the object files, and if I launch the executable from the extension console, it does not try to change the console to the build console. This is new, but I think it is relative to cmake plugin.

Then, the executable is well found and launched : the debug console display the same message.
I can add a breakpoint and hit F5 to have a step by step.
But the error message is still added to the extension console and no "hello world"

Here is launch.json:

"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/home/christian/Documents/monrobot/testcmake6/build/testcmake6",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

I have the same issue on MacOS High Sierra, with lldb.
This is my launch.json:

{
    "name": "(lldb) Launch",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceFolder}/build/Chapter08/Chapter08",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": true,
    "MIMode": "lldb",
    "miDebuggerPath":  "/Users/${env:USER}/.vscode/extensions/ms-vscode.cpptools-0.17.7/debugAdapters/lldb/bin/lldb-mi"
}

same issues on Win10 with MinGW and GDB. But no issues on another PC

In my case the extension stopped working out of the blue. The message "waiting for v8 protocol on stdin/stdout" is always printed; that's not a symptom of something wrong.

In my case, the project I was debugging crashed even before reaching the entry, letting the extension waiting forever for the debugger to reply back.

Luckily, the _CALL STACK_ window showed me that and a rebuild of the project solved the issue.

For the records, my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/git.exe",
            "args": ["add", "a.if"],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/t/trash directory.t3700-add/",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "c:/git-sdk-64/mingw64/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}
Was this page helpful?
0 / 5 - 0 ratings