debug/gosym: func (*Sym) PackageName() returns wrong package names #29551
Labels
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?What did you do?
I am using PackageName() on the symbol table to get the list of packages at run-time.
But it returns some unexpected values for symbols not only prefixed by the package name. Such as
type..eq.
andtype..hash.
.For example
PackageName()
on symbols:type..eq.runtime._panic
returnstype
instead ofruntime
type..hash.github.com/golang/protobuf/proto.textWriter
returnstype..hash.github.com/golang/protobuf/proto
So either
PackageName()
needs to handle this case, or these prefixes should come after the package name so thatPackageName()
's expectations are true, ie. the prefix before is the package name.Here is the piece of code reading the symbol table of the currently running executable file:
The text was updated successfully, but these errors were encountered: