microsoft / microsoft/vscode-cpptools

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

Aperta
#6,352 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger more info needed
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il problema con i due moduli di esempio, file1.c e file2.c, che definiscono struct distinti con lo stesso nome. Inizia impostando un breakpoint su un’istanza di file2.c e ispezionala nella finestra di osservazione o nella console del debugger. Il lavoro è completato quando il debugger mostra i campi e i valori di file2.c usando il tipo corretto invece della definizione di file1.c.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.