You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using standards debugger (Delve for instance) I tried to read some variable inside a function below is the sample code
package main
import "fmt"
type Day int
const (
MONDAY Day = 1 + iota
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
)
var i int = 100
var f float64 = 100.1
var s string = "Hello world!"
var a [5]int = [5]int{1, 2, 3, 4, 5}
var d Day = TUESDAY
var c complex64 = 1 + 1i
func printParams(i int, f float64, s string, a [5]int, b []int, p *int, d Day, c complex64) {
fmt.Println("Entering printParams")
fmt.Println(i)
fmt.Println(f)
fmt.Println(s)
fmt.Println(d)
fmt.Println(c)
for _, ai := range a {
fmt.Println(ai)
}
for i := 0; i < len(b); i++ {
fmt.Println(b[i])
}
b = append(b, 11)
b = append(b, 12)
b[0] = 14
for i := 0; i < len(b); i++ {
fmt.Println(b[i])
}
fmt.Println(*p)
fmt.Println("Exiting printParams")
}
func main() {
printParams(i, f, s, a, a[1:4], &i, d, 1i)
}
Also I tried to read DWARF section using readelf
What did you expect to see?
I expect to get below result while stepping into printParams function line 13 and 20:
(dlv) args
i = 100
f = 100.1
s = "Hello world!"
a = [5]int [...]
b = []int len: 3, cap: 4, [...]
p = (*int)(0x553120)
d = TUESDAY (2)
c = (0 + 1i)
(dlv) args
i = 100
f = 100.1
s = (unreadable empty OP stack)
a = [5]int [...]
b = (unreadable could not find loclist entry at 0x8648e for address 0x497a9e)
p = (*int)(0x535118)
d = TUESDAY (2)
c = (unreadable empty OP stack)
Thanks for trying the release candidate. Sounds like this will be fixed in 1.17, and it's not the sort of thing we normally backport to earlier releases, so closing.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It was working on 1.14.9 but not after that
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using standards debugger (Delve for instance) I tried to read some variable inside a function below is the sample code
Also I tried to read DWARF section using
readelf
What did you expect to see?
I expect to get below result while stepping into
printParams
function line 13 and 20:And in DWARF:
I got above result from 1.14.9 version
What did you see instead?
From the debugger I got this part instead:
And the DWARF section is like this:
I created another issue (#45680) before not sure whether that one cover this one or no
The text was updated successfully, but these errors were encountered: