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 dyninst, I tried to access local variables and arguments of a function which is part of a go binary compiled with linkshared option. To get local variables, dyninst uses libdw library to find all the modules. It uses dwarf_nextcu function of libdw to find all the modules of binary.
When I compile a go binary using "go build filename.go" then dwarf_nextcu finds all the modules (almost 118) and dyninst is able to access local variables and arguments of any function.
But when I compile a go binary with linkshared option "go build -linkshared filename.go" then dwarf_nextcu finds only 5 modules. Due to that, dyninst is not able to access any variable of a function.
When I contact libdw team, they checked the symbols of both the binaries and gave a response.
Response from libdw team:
"So the information you want to extract from them is simply not there for the Go compiler generated functions. This is probably a bug you should produce to the Go language team or Ubuntu (if it is specific to their packaging)."
Is this a bug in go or there is any other way to read the symbols.
What did you expect to see?
I should be able to access variables of a function of go linkshared binary
What did you see instead?
Could not access variable of a function.
The text was updated successfully, but these errors were encountered:
I believe currently debug info generation is not enabled for shared libraries. See #38378. I think we can close this and combine it into that issue. Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes with every version of go
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using dyninst, I tried to access local variables and arguments of a function which is part of a go binary compiled with linkshared option. To get local variables, dyninst uses libdw library to find all the modules. It uses dwarf_nextcu function of libdw to find all the modules of binary.
When I compile a go binary using "go build filename.go" then dwarf_nextcu finds all the modules (almost 118) and dyninst is able to access local variables and arguments of any function.
But when I compile a go binary with linkshared option "go build -linkshared filename.go" then dwarf_nextcu finds only 5 modules. Due to that, dyninst is not able to access any variable of a function.
When I contact libdw team, they checked the symbols of both the binaries and gave a response.
//go binary without linkshared
$ eu-readelf --debug-dump=info wrapecho.txt | grep producer | sort | uniq -c
1 producer (string) "GNU AS 2.25"
147 producer (string) "Go cmd/compile go1.15.1"
2 producer (strp) "GNU C11 6.5.0 20181026"
16 producer (strp) "GNU C 4.9.2"
//go binry with linkshared
$ eu-readelf --debug-dump=info wrapecho_linkshared.txt | grep producer | sort | uniq -c
1 producer (string) "GNU AS 2.26.1"
18 producer (strp) "GNU C11 6.5.0 20181026"
Response from libdw team:
"So the information you want to extract from them is simply not there for the Go compiler generated functions. This is probably a bug you should produce to the Go language team or Ubuntu (if it is specific to their packaging)."
Is this a bug in go or there is any other way to read the symbols.
What did you expect to see?
I should be able to access variables of a function of go linkshared binary
What did you see instead?
Could not access variable of a function.
The text was updated successfully, but these errors were encountered: