microsoft / microsoft/vscode-cpptools

Unable to paste multiple lines to integrated terminal while debugging C++

Open
#12,191 6 comments 3 reactions 1 assignee View on GitHub

@browntarik is already working on this.

Since Apr 12, 2024.

debugger help wanted Language Service more info needed
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Windows11 23H2
  • VS Code:1.88.0
  • C/C++ extension:1.19.9
  • GDB / LLDB version:13.2
Bug Summary and Steps to Reproduce

Steps to Reproduce:

#include
using namespace std;

int main() {
char x;
cin >> x;
cout << "hello";
cout << "world";
cin >> x;
return 0;
}
If you add a breakpoint on the line cout << "hello" ;, step over does not work after pasting multiple lines to the terminal.

recording

Debugger Configurations
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe build active file",
            "command": "D:\\application_code\\msys64\\mingw64\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "Task generated by Debugger."
        },
    ],
    "version": "2.0.0"
}

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": " g++.exe ",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "d:\\application_code\\msys64\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++.exe build active file",
            
        },
    ]
}
Debugger Logs
1: (7091) <-1031-exec-next 
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7092) ->1031^running\r\n"},"seq":777}
1: (7092) ->1031^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7092) ->*running,thread-id=\"all\"\r\n"},"seq":779}
1: (7092) ->*running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7092) ->(gdb)\r\n"},"seq":781}
1: (7092) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7093) 1031: elapsed time 1\r\n"},"seq":783}
1: (7093) 1031: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7093) ->&\"\\n\"\r\n"},"seq":785}
1: (7093) ->&"\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7093) ->^done\r\n"},"seq":787}
1: (7093) ->^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (7093) ->(gdb)\r\n"},"seq":789}
1: (7093) ->(gdb)
--> R (next-17): {"type":"response","request_seq":17,"success":true,"command":"next","body":{},"seq":791}
Other Extensions

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.