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 declaration line in debug_info for variables captured in a closure #36542

Closed
aarzilli opened this issue Jan 14, 2020 · 2 comments
Labels
Debugging FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@aarzilli
Copy link
Contributor

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

$ go version
go version devel +f376b8510e Fri Jan 3 01:36:26 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

Compile:

package main

import (
	"fmt"
)

func f1(a int) {
	fmt.Printf("a: %d\n", a)
}

func main() {
	a := 1
	f := func() {
		f1(a)
	}
	f()
}

check the DW_AT_decl_line attribute of the variable a in main.main.func1

What did you expect to see?

line 12

What did you see instead?

line 14 (the first use of a inside the closure).

@aarzilli
Copy link
Contributor Author

Note: this is not a regression.

@gopherbot
Copy link

Change https://golang.org/cl/214637 mentions this issue: cmd/compile: assign correct declaration line to DIE of captured vars

@ALTree ALTree added Debugging NeedsFix The path to resolution is known, but the work has not been done. labels Jan 14, 2020
@ALTree ALTree added this to the Backlog milestone Jan 14, 2020
@golang golang locked and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debugging FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants