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

cmd/compile: wrong DWARF scope for captured variable #21515

Closed
aarzilli opened this issue Aug 18, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@aarzilli
Copy link
Contributor

commented Aug 18, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +b73d46d Fri Aug 18 05:29:56 2017 +0000 linux/amd64

What did you do?

Compiled this without optimizations.

What did you expect to see?

b and f in the same lexical block.

What did you see instead?

 <1><2683e>: Abbrev Number: 2 (DW_TAG_subprogram)
    <2683f>   DW_AT_name        : main.makef
    <2684a>   DW_AT_low_pc      : 0x485c30
    <26852>   DW_AT_high_pc     : 0x485dc6
    <2685a>   DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <2685c>   DW_AT_external    : 1
 <2><2685d>: Abbrev Number: 4 (DW_TAG_variable)
    <2685e>   DW_AT_name        : b
    <26860>   DW_AT_location    : 5 byte block: 9c 11 88 7f 22  (DW_OP_call_frame_cfa; DW_OP_consts: -120; DW_OP_plus)
    <26866>   DW_AT_type        : <0x283a6>
 <2><2686a>: Abbrev Number: 4 (DW_TAG_variable)
    <2686b>   DW_AT_name        : a
    <2686d>   DW_AT_location    : 5 byte block: 9c 11 90 7f 22  (DW_OP_call_frame_cfa; DW_OP_consts: -112; DW_OP_plus)
    <26873>   DW_AT_type        : <0x283a6>
 <2><26877>: Abbrev Number: 6 (DW_TAG_formal_parameter)
    <26878>   DW_AT_name        : flag
    <2687d>   DW_AT_location    : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <2687f>   DW_AT_type        : <0x26b8f>
 <2><26883>: Abbrev Number: 6 (DW_TAG_formal_parameter)
    <26884>   DW_AT_name        : ~r1
    <26888>   DW_AT_location    : 4 byte block: 9c 11 8 22      (DW_OP_call_frame_cfa; DW_OP_consts: 8; DW_OP_plus)
    <2688d>   DW_AT_type        : <0x35ccf>
 <2><26891>: Abbrev Number: 9 (DW_TAG_lexical_block)
    <26892>   DW_AT_low_pc      : 0x485c82
    <2689a>   DW_AT_high_pc     : 0x485ce3
 <3><268a2>: Abbrev Number: 4 (DW_TAG_variable)
    <268a3>   DW_AT_name        : f
    <268a5>   DW_AT_location    : 5 byte block: 9c 11 a0 7f 22  (DW_OP_call_frame_cfa; DW_OP_consts: -96; DW_OP_plus)
    <268ab>   DW_AT_type        : <0x35ccf>
 <3><268af>: Abbrev Number: 0
 <2><268b0>: Abbrev Number: 0
@gopherbot

This comment has been minimized.

Copy link

commented Aug 18, 2017

Change https://golang.org/cl/56830 mentions this issue: cmd/compile: fix lexical block of captured variables

@heschik heschik added the Debugging label Aug 18, 2017

@gopherbot gopherbot closed this in e1cf2be Sep 15, 2017

@golang golang locked and limited conversation to collaborators Sep 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.