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?
to your account
Using tip (linux.amd64)
$ go version
go version devel +565e70fcef Mon Mar 29 08:11:13 2021 +0000 linux/amd64
Compile this program:
and look at the DWARF generated for the function main.tryme
Correct location expressions for all params
For the parameter "z", here is the parameter DIE:
<2><3c428>: Abbrev Number: 16 (DW_TAG_formal_parameter)
<3c429> DW_AT_name : z
<3c42b> DW_AT_variable_parameter: 0
<3c42c> DW_AT_decl_line : 7
<3c42d> DW_AT_type : <0x3e46a>
<3c431> DW_AT_location : 0x5a5a3 (location list)
and here is the relevent .debug_loc section:
0005a5a3 ffffffffffffffff 000000000045f340 (base address)
0005a5b3 000000000045f340 000000000045f399 (DW_OP_fbreg: 24; DW_OP_piece: 8; DW_OP_fbreg: 24; DW_OP_piece: 8)
0005a5cd <End of list>
Note the two pieces are the same (for real and imaginary). If I stop in a debugger and print the value of the param, I get:
(gdb) p z
$1 = 2 + 2i
which is obviously wrong (should be 1 + 2i).
I looked at older versions of Go (1.15, 1.14, and it appears that they get this wrong as well, although in slightly different ways).
The text was updated successfully, but these errors were encountered:
No branches or pull requests