microsoft / microsoft/vscode-cpptools
the debugger gets confused on same named structs that defined in separate c modules
Nadie ha tomado este issue todavía.
- 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:
- Create two C files for example file1.c and file2.c
- 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.
-
create an instance of second type of "hey". put some breakpoint to examine struct's data
-
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
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- 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