mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
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:
@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user