microsoft / microsoft/vscode-cpptools
debugging inside a lambda that captures this shows the 'lambda' this instead of the 'this' 'this'
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: Bug
I admit that the context for the debugger is kind of ambiguous. Lambdas are generated as anonymous structs and the lambda itself is a method on this anonymous struct. However
struct Foo {
void do(){
auto l = [this]{
foo = 10; // <- stop debugger here
};
l();
}
int foo 0;
}
when you look at the debugger a this in the locals shown but it's actually the lambda rather than the Foo class. Also it is not possible to inspect member foo from the point where the debugger is stopped
Extension version: 1.20.1
VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z)
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 9 5900X 12-Core Processor (24 x 3700) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | undefined |
| Memory (System) | 63.93GB (35.99GB free) |
| Process Argv | --crash-reporter-id 8e0f3da2-bd7f-4547-b593-29b86ad0a63e |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonait:31006305
jchc7451:30973076
gee8j676:31009558
dsvsc021:30996838
9c06g630:31013171
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
Riproduci il problema con l’esempio di lambda C++ fornito in VS Code usando l’estensione C/C++, fermandoti sull’assegnazione contrassegnata. Inizia tracciando il modo in cui il debugger presenta le variabili locali e i valori this catturati; il lavoro è concluso quando lo stack frame in cui l’esecuzione è sospesa espone l’istanza di Foo e consente di ispezionare foo, invece di mostrare solo l’oggetto lambda.
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
- Abbastanza chiara
- Idoneità per principianti
- 42/100