Golang binary dwarf

Manoj Kumar manoj.gurukul@yahoo.com
Sat Feb 6 07:03:26 GMT 2021


Hi,Using dyninst, I am trying to access local variables and arguments of a function which is part of a go binary.To get local variables, dyninst uses libdw 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.
Does go binary with linkshared option has different version of dwarf? Could you please suggest how to use libdw for go binary with linkshared option.
Thanks



More information about the Elfutils-devel mailing list