OS and version of remote machine (if applicable): None
GDB / LLDB version: GNU gdb (GDB for MinGW-W64 x86_64, built by Brecht Sanders) 13.1
Bug Summary and Steps to Reproduce
Bug Summary: When using the GDB from MinGW-W64 and debugging a program, if I paste some input into the terminal before the control flow reaches a scanf call, the debugger hangs after the scanf call as if it's stuck in an infinite loop.
int main(void)
{
size_t height = 0, width = 0;
scanf("%zu %zu", &height, &width);
int maze[height][width];
}
with the play button and select the compiler you just downloaded, with a breakpoint at line 6(at the `scanf`). No `launch.json` or `task.json` required.
3. When the execution stops at line 6, paste this line into the terminal:
1 1
4. Press step over and observe that the debugger just hangs.
### Debugger Configurations
```shell
None
Debugger Logs
=thread-group-added,id="i1"
GNU gdb (GDB for MinGW-W64 x86_64, built by Brecht Sanders) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
[New Thread 14560.0x49dc]
Thread 1 hit Breakpoint 1, 0x00007ff6fdaf17ea in main () at D:\Desktop\C\College\Portal\Portal1.c:4
4 {
Loaded 'C:\WINDOWS\SYSTEM32\ntdll.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\kernel32.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\KernelBase.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\ucrtbase.dll'. Symbols loaded.
Thread 1 hit Breakpoint 2, main () at D:\Desktop\C\College\Portal\Portal1.c:6
6 scanf("%zu %zu", &height, &width);
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
Other Extensions
No response
Additional Information
This problem doesn't occur if I use the GDB that came with TDM-GCC 10.3.0.
settings.json:
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.
Environment
Bug Summary and Steps to Reproduce
Bug Summary: When using the GDB from MinGW-W64 and debugging a program, if I paste some input into the terminal before the control flow reaches a
scanf
call, the debugger hangs after thescanf
call as if it's stuck in an infinite loop.Steps to reproduce:
int main(void) { size_t height = 0, width = 0; scanf("%zu %zu", &height, &width); int maze[height][width]; }
1 1
Debugger Logs
Other Extensions
No response
Additional Information
This problem doesn't occur if I use the GDB that came with TDM-GCC 10.3.0.
settings.json
: