microsoft / microsoft/vscode-cpptools

the debugger gets confused on same named structs that defined in separate c modules

Abierto
#6,352 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

debugger more info needed
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

Type: Debugger

Describe the bug

  • OS and Version: Windows 10 (10.0.19041)
  • VS Code Version: 1.50.1 (user setup)
  • C/C++ Extension Version: v1.0.1
  • Other extensions you installed (and if the issue persists after disabling them): ARM (Syntax Highligter), CMake, Cmake Tools, Go, Python, x86 and x86_64 Assembly (Syntax highligther)
  • A clear and concise description of what the bug is.

The debugger does not map correct type info for identical named structs that has different fields on separate c modules.

Steps to Reproduce:

  1. Create two C files for example file1.c and file2.c
  2. Define a struct in each c file with identical name but different fields. for example

in file1.c

typedef struct _hey
{
    char chrarr[60];
    int intval;
}hey;

in file2.c

typedef struct _hey
{
    char chrarr[20];
    int intval;
    int a;
    int b;
}hey;

As you know, these types are not exported outside of the module, so these types are internal and isolated from each other.

  1. create an instance of second type of "hey". put some breakpoint to examine struct's data

  2. when breakpoint hit, add the variable into watch window or just type into debugger console.

Expected result: debugger should have mapped and displayed file2.c's hey type.
Experienced result: debugger maps and shows the data using file1.c's "hey" type instead of file2.c's

Ps: If the issue could not reproduce please try to create an instance for first one. Because I'm not sure that which type have been chosen by the vscode.

Guía de contribución

Abrir la 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.

Línea de trabajo

Reproduce el problema con los dos módulos de ejemplo, file1.c y file2.c, que definen estructuras independientes con el mismo nombre. Comienza colocando un breakpoint en una instancia de file2.c e inspecciónala en la ventana de inspección o en la consola del depurador. Se considera terminado cuando el depurador muestra los campos y valores de file2.c usando el tipo correcto en lugar de la definición de file1.c.

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

Evaluación

Stack tecnológico
c
Área
devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.