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
gdb: not showing Go strings values as initialized #6599
Milestone
Comments
info locals shows all string variables, not just the ones that have been initialized. Are you sure that the very long ones really are initialized at the point in the program where your breakpoint is? Labels changed: added priority-later, removed priority-triage. Status changed to WaitingForReply. |
Thank you for the suggestions. To make sure that all of the binaries have the debugging flags I deleted the executable from the $GOPATH/bin directory and removed the entire $GOPATH/pkg directory to prevent any lingering archives from being linked in to my executable. I am building the binary again using 'go install -gcflags "-N -l" github.com/sirnewton01/godev' I repeated my experiment with go 1.1.2 (according to godeb and go version). When I hit my breakpoint I can see that many of the local strings have nonsensical values (very large integers lengths with the patch from issue #6598). This is expected since the strings are not yet initialized. I step over the lines that should initialize the strings and when I invoke "info locals" I can see that, for the most part, the strings are getting their correct values. There was one variable that never appeared to get initialized but it was declared and used only inside a for loop. I don't know if that makes a difference. I repeated the above experiment using go version 1.2rc2 (according to godeb and go version). When I hit my breakpoint this time and look at "info locals" I see that the values have nonsensical large integer values but when I step over lines that should initialize them they retain their nonsensical values (e.g. filePath := ""). I wonder if the line number information is somehow skewed in Go 1.2 so that I hit the breakpoint at the wrong line of the file. It might explain that when I step over the lines that I think I'm stepping over the initialization of the variables won't happen until later. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
by newton688:
The text was updated successfully, but these errors were encountered: