Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 19318 - Variables captured from outer functions not visible in debugger #8906

Merged
merged 1 commit into from
Nov 4, 2018

Conversation

rainers
Copy link
Member

@rainers rainers commented Nov 3, 2018

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.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @rainers!

Bugzilla references

Auto-close Bugzilla Severity Description
19318 normal Variables captured from outer functions not visible in debugger

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#8906"

@thewilsonator
Copy link
Contributor

@rainers any idea whats with the Win32 failures?

HOST_DC=/home/braddr/sandbox/at-client/release-build/dmd-2.079.0/windows/bin/dmd.exe
HOST_DC=C:\cygwin\home\braddr\sandbox\at-client\release-build\dmd-2.079.0\windows\bin\dmd.exe
cd test
gmake -j3
Creating output directory: test_results
Building d_do_test tool
Building sanitize_json tool
OS: 'win32'
OS: 'win32'
MODEL: '32'
MODEL: '32'
PIC: ''
../generated/windows/release/32/dmd.exe -conf= -m32  -g -unittest -run tools/d_do_test.d
PIC: ''
../generated/windows/release/32/dmd.exe -conf= -m32  -g -odtest_results -oftest_results\\sanitize_json.exe -i tools/sanitize_json.d
Error: linker exited with status 1
Makefile:171: recipe for target 'test_results/d_do_test.exe' failed
gmake: *** [test_results/d_do_test.exe] Error 1

--- errorlevel 2

@rainers
Copy link
Member Author

rainers commented Nov 4, 2018

@rainers any idea whats with the Win32 failures?

Oops, that's a crash in optlink.

@thewilsonator
Copy link
Contributor

Wonderful, how do we proceed from here then?

@rainers
Copy link
Member Author

rainers commented Nov 4, 2018

I have investigated it a bit:

  • I suspect optlink doesn't like the negative offsets that are specified for the struct members
  • it also crashes if I make them unsigned, but large (works ok with COFF, too, but looks ugly when dumped)
  • objtoasm also doesn't understand these records
  • cv2pdb strips the hidden context pointers anyway due to inconsistent debug information with the function type

-> I'll just disable the output for OMF

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants