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: escaped local variables aren't assigned to the correct lexical block in debug_info #20959

Closed
aarzilli opened this issue Jul 9, 2017 · 3 comments
Milestone

Comments

@aarzilli
Copy link
Contributor

aarzilli commented Jul 9, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.9 beta 2

What did you do?

Compiled this program with -gcflags '-N -l', ran objdump --dwarf

Result:

 <1><26358>: Abbrev Number: 2 (DW_TAG_subprogram)
    <26359>   DW_AT_name        : main.main
    <26363>   DW_AT_low_pc      : 0x487a50
    <2636b>   DW_AT_high_pc     : 0x487ce7
    <26373>   DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <26375>   DW_AT_external    : 1
 <2><26376>: Abbrev Number: 4 (DW_TAG_variable)
    <26377>   DW_AT_name        : &a
    <2637a>   DW_AT_location    : 5 byte block: 9c 11 e8 7e 22  (DW_OP_call_frame_cfa; DW_OP_consts: -152; DW_OP_plus)
    <26380>   DW_AT_type        : <0x32175>
 <2><26384>: Abbrev Number: 6 (DW_TAG_lexical_block)
    <26385>   DW_AT_ranges      : 0x0
 <3><26389>: Abbrev Number: 4 (DW_TAG_variable)
    <2638a>   DW_AT_name        : a
    <2638c>   DW_AT_location    : 5 byte block: 9c 11 b0 7e 22  (DW_OP_call_frame_cfa; DW_OP_consts: -208; DW_OP_plus)
    <26392>   DW_AT_type        : <0x27f27>
 <3><26396>: Abbrev Number: 6 (DW_TAG_lexical_block)
    <26397>   DW_AT_ranges      : 0x40
 <4><2639b>: Abbrev Number: 4 (DW_TAG_variable)
    <2639c>   DW_AT_name        : p
    <2639e>   DW_AT_location    : 5 byte block: 9c 11 c8 7e 22  (DW_OP_call_frame_cfa; DW_OP_consts: -184; DW_OP_plus)
    <263a4>   DW_AT_type        : <0x32175>
 <4><263a8>: Abbrev Number: 0
 <3><263a9>: Abbrev Number: 0
 <2><263aa>: Abbrev Number: 0

The &a variable should have been inside the second lexical block, together with p.

@gopherbot
Copy link

CL https://golang.org/cl/47852 mentions this issue.

@aarzilli
Copy link
Contributor Author

aarzilli commented Jul 9, 2017

cc @mdempsky

@odeke-em odeke-em modified the milestones: Go1.10, Go1.9 Jul 9, 2017
@odeke-em
Copy link
Member

I've updated the milestone to Go1.9 as per the consensus on the CL.

@golang golang locked and limited conversation to collaborators Jul 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants