I'm using VSCode version 1.71.0 784b0177c56c607789f9638da7b6bf3230d47a8c x64 on Ubuntu Linux version 22.04.1 LTS. I'm compiling with GCC version 11.2.0 but the same problem occurs when the application is compiled with Clang 14.0.0 and Clang 16.0.0. My version of GDB is 12.0.90. I'm using C/C++ v.1.12.4 and CMake Tools v1.12.26 plugins for VSCode. I start debugging session with the CMake: Debug command by default assigned to the F5 shortcut. For some time the application I'm debugging started to crash when a breakpoint is hit. The exact message is the following:
Aborted (core dumped)
[1] + Aborted (core dumped) "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-ifoflcfq.xvl" 1>"/tmp/Microsoft-MIEngine-Out-h4yklwfm.ghy"
The same problem does not occur when I'm using GDB from the command line and for that reason, I assume that the problem is related to the integration of GDB with VSCode. I cannot reproduce the problem with a small program. For a small test application, it works fine. At the beginning of debugging session, the following warning is displayed for a small amount of time before the terminal is cleared and the logs of the debugged application started to appear.
warning: GDB: Failed to set controlling terminal: Operation not permitted
I'm not sure whether it is somehow related to the problem.