D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19318 - Variables captured from outer functions not visible in debugger
Summary: Variables captured from outer functions not visible in debugger
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: DebugInfo, pull
Depends on:
Blocks:
 
Reported: 2018-10-20 09:21 UTC by Rainer Schuetze
Modified: 2018-11-04 12:11 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Schuetze 2018-10-20 09:21:53 UTC
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 Rainer Schuetze 2018-11-03 20:56:35 UTC
https://github.com/dlang/dmd/pull/8906
Comment 2 github-bugzilla 2018-11-04 12:11:02 UTC
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