microsoft / microsoft/vscode-cpptools
[OSX] lldb cannot read bitfield dwarf debug info generated by -mmacosx-version-min=10.11
Nessuno ha ancora preso questa issue.
- 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: MacOSX 10.4.1
- VS Code Version: 1.29.0
- C/C++ Extension Version: 0.20.1
- A clear and concise description of what the bug is.
Starting from MacOSX target 10.11, clang tunes it's debug information for lldb. This causes the version of lldb embedded in the cpptools extension to misreport bitfield values.
To Reproduce
#include <stdio.h>
int main() {
struct Test {
unsigned short a;
unsigned short b : 1;
unsigned short c: 15;
};
Test x = {0};
x.a = 5;
printf("%hu", x.b);
return 0;
}
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb"
}
]
}
Steps to reproduce the behavior:
- Run
clang++ test.cc -mmacosx-version-min=10.11 -g - Place a breakpoint at line 10:
x.a = 5 - Launch debugger
- Step over
x.a = 5and see thatx.borx.cchanges value (lldb cannot find the right addresses for the bitfields.
Additional context
Compilation where older lldb works:
clang++ -c test.cc -mmacosx-version-min=10.10 -gclang++ -c test.cc -mmacosx-version-min=10.11 -ggdb
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il caso minimo test.cc con clang++ usando -mmacosx-version-min=10.10 e 10.11, quindi avvialo con la configurazione .vscode/launch.json fornita. Confronta come il debugger segnala x.b e x.c dopo aver eseguito un'operazione step over su x.a = 5; completato significa che i valori dei bitfield rimangono corretti per il target 10.11.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100