mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/pprof: don't use offset if we don't have a start address
The test is in the runtime package because there are other tests of pprof there. At some point we should probably move them all into a pprof testsuite. Fixes #16128. Change-Id: Ieefa40c61cf3edde11fe0cf04da1debfd8b3d7c0 Reviewed-on: https://go-review.googlesource.com/24274 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
09834d1c08
commit
252eda470a
3 changed files with 93 additions and 2 deletions
|
|
@ -117,8 +117,10 @@ func (*objTool) Open(name string, start uint64) (plugin.ObjFile, error) {
|
|||
name: name,
|
||||
file: of,
|
||||
}
|
||||
if load, err := of.LoadAddress(); err == nil {
|
||||
f.offset = start - load
|
||||
if start != 0 {
|
||||
if load, err := of.LoadAddress(); err == nil {
|
||||
f.offset = start - load
|
||||
}
|
||||
}
|
||||
return f, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue