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: bad DWARF location for variable #58813
Comments
CC @golang/compiler. |
@dr2chase assigned to you in triage since we want your input but feel free to unassign. |
I think this "fixed itself" which is not happy-making. A more permanent fix would be, when assigning line numbers in |
In case it helps, here is another case extracted from this stackoverflow question : 1 package main
2
3 func main() {
4 a := f(1)
5 b := 1
6
7 c := a < b
8 _ = c
9 }
10
11 func f(i int) int {
12 if i > 0 {
13 return i
14 }
15 return -i
16 } And here is the output of a delve debug session:
|
Another example, this one on arm64:
SimpleMethodWithArguments compiles to:
at 0x4977d3, the first statement, the stack variables are not yet initialized. |
Given the following code:
Compiled with `-gcflags='all=-N -l', main.cul function compiles into:
and the variable
id
hasDW_OP_fbreg -0x18
has its location, however at instruction 0x49c8ea, which is the instruction picked for a breakpoint on line:8
, the variable is stored on register rcx, not in its stack location (where it gets moved only later at instruction 0x49c8ed).Originally reported as go-delve/delve#3290.
cc @dr2chase.
The text was updated successfully, but these errors were encountered: