Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`cppdbg` / MIEngine loses debugger control with `gdb 17.1` in Linux dev container, while `gdb 16.2` works

Abierto
#1,607 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
csharp

Línea de trabajo

Empieza reproduciendo la matriz de comparación del issue: cppdbg con GDB 17.1 y 16.2, y después el comando manual de inicio de MI. Lee el comportamiento de MIEngine en torno al lanzamiento, el control y la interacción con el terminal reportados; se considera completado cuando se haya identificado la causa de compatibilidad y se hayan restablecido los breakpoints, la pausa, la inspección y la terminación limpia con GDB 17.1.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

question

Summary

In a Linux VS Code dev container, cppdbg with MIMode: "gdb" starts gdb 17.1 and launches the inferior process, but VS Code never gains usable debugger control.

Observed behavior with gdb 17.1:

  • The debuggee process starts.
  • The VS Code debugger UI does not become operational.
  • Pause does not work.
  • The session does not finish normally.
  • In practice the gdb process must be killed manually.

The same setup works when either of these is true:

  • cppdbg uses gdb 16.2
  • the WebFreak GDB adapter is used instead of Microsoft cppdbg

That strongly suggests an MIEngine compatibility issue with gdb 17.1, rather than a generic container TTY or ptrace problem.

Environment

  • Host workflow: VS Code connected to a Linux dev container
  • VS Code version: 1.128.0
  • OS inside container: Ubuntu 26.04 (Resolute Raccoon)
  • gdb failing with cppdbg: GNU gdb (Ubuntu 17.1-2ubuntu1) 17.1
  • gdb working with cppdbg: GNU gdb (GDB) 16.2
  • GCC in container: gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0
  • VS Code extensions in container:
    • ms-vscode.cpptools 1.32.2-linux-x64
    • ms-vscode.cpp-devtools 0.5.13
    • ms-vscode.cmake-tools 1.23.52
    • webfreak.debug 0.27.0
    • vadimcn.vscode-lldb 1.12.2

Container run arguments:

[
  "--network=host",
  "--cap-add=SYS_PTRACE",
  "--security-opt=seccomp=unconfined",
  "--security-opt=apparmor=unconfined"
]

Relevant container facts already checked:

  • /dev/pts is mounted and usable
  • tty returns a valid pseudo-terminal
  • kernel.yama.ptrace_scope = 1
  • NoNewPrivs: 0

Minimal repro configuration

This reproduces with a standard cppdbg launch configuration using MIMode: "gdb":

{
  "name": "Linux Debug",
  "type": "cppdbg",
  "request": "launch",
  "program": "/path/to/test-binary",
  "cwd": "/path/to/workspace",
  "externalConsole": false,
  "MIMode": "gdb",
  "miDebuggerPath": "/usr/bin/gdb",
  "setupCommands": [
    {
      "description": "Enable pretty-printing for GDB.",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
    },
    {
      "description": "Disable debuginfod prompts.",
      "text": "-gdb-set debuginfod enabled off",
      "ignoreFailures": true
    }
  ]
}

The same configuration works after changing only:

"miDebuggerPath": "/opt/gdb-16.2/bin/gdb"

Observed behavior

With gdb 17.1:

  • VS Code starts gdb.
  • The inferior process is started.
  • The debugger does not attach in a usable way from the VS Code side.
  • Pause is non-functional.
  • The session remains stuck until gdb is killed.

Debug Console output:

=thread-group-added,id="i1"
GNU gdb (Ubuntu 17.1-2ubuntu1) 17.1
Copyright (C) 2025 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-linux-gnu".
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"

Integrated terminal output:

⚠️ warning: GDB: Failed to set controlling terminal: Operation not permitted

Expected behavior

cppdbg should be able to control the inferior normally with gdb 17.1, the same way it does with gdb 16.2:

  • stop on breakpoints
  • pause on demand
  • inspect state
  • terminate cleanly

Comparison matrix

Adapter GDB version Result
cppdbg 17.1 Fails: inferior starts, VS Code never gains usable control
cppdbg 16.2 Works
webfreak.debug 17.1 Works

Additional observations

Manual MI startup with gdb 17.1 works from the shell:

gdb --interpreter=mi --tty="$(tty)" -q /bin/true

That does not reproduce the freeze by itself, which again points away from a generic TTY problem and toward the interaction between MIEngine and gdb 17.1.

The container is already configured with the usual native-debugging allowances:

  • SYS_PTRACE
  • seccomp=unconfined
  • apparmor=unconfined

So this does not appear to be caused by missing ptrace/container permissions.

Regression suspicion

This looks like a compatibility or regression issue between Microsoft MIEngine and gdb 17.1.

The most relevant facts are:

  • cppdbg fails with gdb 17.1
  • cppdbg works with gdb 16.2
  • another GDB adapter works with gdb 17.1
  • plain shell MI startup with gdb 17.1 is possible

Requested guidance

Please clarify:

  1. Whether gdb 17.x is officially supported by the current cppdbg / MIEngine implementation.
  2. Whether there is a known MI protocol incompatibility or regression with gdb 17.1.
  3. Whether the Failed to set controlling terminal warning is expected in remote-container scenarios and, if so, why it results in a non-functional session only for cppdbg.
  4. Whether there is a recommended MIEngine setting or launch option for gdb 17.1 in remote Linux containers.
Lenguaje dominante
C#
Estrellas
861
Forks
233
Merge medio
10 h 31 min
PR fusionados (30 d)
2

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

  • Sin Dockerfile ni archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/MIEngine

Todos los issues de microsoft/MIEngine

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.