Bug 19318 – Variables captured from outer functions not visible in debugger

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2018-10-20T09:21:53Z
Last change time
2018-11-04T12:11:02Z
Keywords
pull, symdeb
Assigned to
No Owner
Creator
Rainer Schuetze

Comments

Comment #0 by r.sagitario — 2018-10-20T09:21:53Z
int fun() @nogc { int x; auto foo() scope { int nested() { return x; } return nested(); } return foo(); } Variable 'x' is not visible in the debugger when stepping through 'foo' or 'nested'. Instead, only an opaque 'void* this' is shown.
Comment #1 by r.sagitario — 2018-11-03T20:56:35Z
Comment #2 by github-bugzilla — 2018-11-04T12:11:02Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/e922ee78128b87e4fad757c51d58ec3e78d3f9c7 fix Issue 19318 - Variables captured from outer functions not visible in debugger create struct type corresponding to the stack variables that are captured by nested functions and assign it to the context pointer in the nested function https://github.com/dlang/dmd/commit/dfc29bcd488a2de335301728fe2185b60c05a391 Merge pull request #8906 from rainers/issue19318 fix Issue 19318 - Variables captured from outer functions not visible in debugger