proc/native: call ElfUpdateSharedObjects after Attach

When attaching to a process in linux ElfUpdateSharedObjects will be
called for the first time during the call to updateThreadList,
unfortunately it won't do anything because the dynamic section of the
base elf executable needs to have been read first and that's done when
we initialize the BinaryInfo object (which happens later during the
call to initialize).
This commit is contained in:
aarzilli
2019-11-27 17:06:13 +01:00
committed by Derek Parker
parent 348432c3b9
commit dd2a59a9a4

View File

@ -118,6 +118,13 @@ func Attach(pid int, debugInfoDirs []string) (*Process, error) {
dbp.Detach(false)
return nil, err
}
// ElfUpdateSharedObjects can only be done after we initialize because it
// needs an initialized BinaryInfo object to work.
err = linutil.ElfUpdateSharedObjects(dbp)
if err != nil {
return nil, err
}
return dbp, nil
}