Closed Dru01 closed 4 months ago
This is very similar to my issue #10834 Btw how did you see the debugger log?
With "logging": { "engineLogging": false } statement. Here is the reference https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-debug-adapter.
FYI, I used to use TDM-GCC 10.3.0 and it didn't have this issue.
Oh okey... I do recall in an early version (compiler,extension,...) also didn't had this issue, but I can't remember which one. I recently had to reset my PC and ever since having this issue.
I tracked down it down to the version of gdb 13.1, installing gcc 11.2 version which comes with gdb 11.1 version it works perfectly fine. There's some incompability between gdb 13.1 and vscode or c++ extension.
Also everything works fine using an external terminal, or using wsl with integrated terminal with gdb 13.1.
@WardenGnaw
@Colengms Is there any new on this?
@WardenGnaw Andrew, could you respond to this issue?
Hi @Dru01 . I work primarily on the language service (non debugger) components of the extension. Andrew works on the debugger side, and should be able to assist.
Thank you for reporting this issue. We’ll let you know if we need more information to investigate it.
@WardenGnaw Andrew, could you respond to this issue?
Hi @Dru01 . I work primarily on the language service (non debugger) components of the extension. Andrew works on the debugger side, and should be able to assist.
Oh I see. Thank you for your reply, I appreciate it.
Thank you for reporting this issue. We’ll let you know if we need more information to investigate it.
No problem, I'm here for anything you required.
@WardenGnaw Do you have any news regarding this issue?
@sean-mcmanus Hi, it's been while since I open this issue and I haven't got any feedback, is there any way you can help me?
If it helps, I discovered two thigs @WardenGnaw.
Recapping as I stated the problem is somewhere between the integrated terminal of vscode and gdb (13.1 or newer). The problem is that if you enter an input in the integrated terminal of vscode before trying to debug the statement (by step over or step into) in charge of getting that input regardless is scanf or cin, it will get stuck somewhere.
After trying to do a step over or a step into that statement the call stack indicates that somethings is running, then when you paused the debugger (two times required to click on pause button, the first time does "nothing") the code stack for [1] will be:
ntdll.dll!ntdll!ZwDeviceIoControlFile (Unknown Source:0)
KernelBase.dll!KERNELBASE!GetConsoleScreenBufferInfoEx (Unknown Source:0)
KernelBase.dll!KERNELBASE!GetConsoleScreenBufferInfoEx (Unknown Source:0)
KernelBase.dll!KERNELBASE!GetConsoleMode (Unknown Source:0)
ucrtbase.dll!ucrtbase!log2f (Unknown Source:0)
ucrtbase.dll!ucrtbase!_read (Unknown Source:0)
ucrtbase.dll!ucrtbase!_fgetc_nolock (Unknown Source:0)
ucrtbase.dll!ucrtbase!fgetc (Unknown Source:0)
libstdc++-6.dll![Unknown/Just-In-Time compiled code] (Unknown Source:0)
main() (d:\La-Ultima-y-Nos-Vamos\Contests\ICPC\Latin_American_Regional_Contest\2023\MainTemplate copy.cpp:9)
And the debug console will output this:
0x00007fffa2593061 in ntdll!DbgBreakPoint () from C:\Windows\SYSTEM32\ntdll.dll
If you keep step over, you will receive something like this from the debugger.
Single stepping until exit from function ntdll!DbgBreakPoint,
which has no line number information.
Single stepping until exit from function ntdll!DbgUiRemoteBreakin,
which has no line number information.
To finally go to the next statement.
I don't know much, but I feel like there a miss check when input is entered while the debugger is running causing a mismatch between them, or my other theory is that there is something about ntdll from windows that is causing those break points, and the vs code debugger is pausing because of it.
I add a video for ilustration
https://github.com/microsoft/vscode-cpptools/assets/37126509/3024196f-da09-438d-a50d-ced640d8be46
This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue.
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
When debugging a c++ program if the input is enter before a step over or step into a 'cin' statement the debuggers hangs/freezes/pause and doesn't continue neither let give any input in the internal terminal.
It's nice to use the integrated terminal and it'll be nice if i can debug some simple programs with the same terminal input over and over again, so I can simple paste it at the beginning.
Steps to reproduce:
Video:
https://user-images.githubusercontent.com/37126509/233818226-7a95daaf-062f-4aba-8863-36493ef4ee24.mp4
Debugger Configurations
Other Extensions
No response
Additional Information
No response