Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version devel +2b445c7 Sat Nov 5 23:59:04 2016 +0000 linux/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/a/n/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build237842021=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
Compiled this with go build -gcflags='-N -l'
What did you expect to see?
I expected .debug_info to have entries for the anonymous types map[string]main.astruct, []main.astruct and for the named type main.astruct.
What did you see instead?
None of those.
I presume this is deliberate and types that are not referenced by any variable are pruned from debug_info. In delve to print the value of an interface variable we used to parse the value of their tab._type field to reconstruct the name of the type and then look that up in debug_info, how should we do this now? If the answer is "you should use runtime._type directly" then at least runtime.slicetype, runtime.arraytype, runtime.maptype, etc... should always be included in debug_info so that we don't have to hardcode them into the debugger for every version of go.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version)?What operating system and processor architecture are you using (
go env)?What did you do?
Compiled this with
go build -gcflags='-N -l'What did you expect to see?
I expected
.debug_infoto have entries for the anonymous typesmap[string]main.astruct,[]main.astructand for the named typemain.astruct.What did you see instead?
None of those.
I presume this is deliberate and types that are not referenced by any variable are pruned from debug_info. In delve to print the value of an interface variable we used to parse the value of their
tab._typefield to reconstruct the name of the type and then look that up in debug_info, how should we do this now? If the answer is "you should use runtime._type directly" then at leastruntime.slicetype,runtime.arraytype,runtime.maptype, etc... should always be included in debug_info so that we don't have to hardcode them into the debugger for every version of go.