diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-06-20 14:00:58 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-06-21 01:44:38 +0000 |
commit | 252eda470a3684a1ead5956f7e703532f4213f11 (patch) | |
tree | 8f38ecd99ce5ca03932ee6af1be99eb241ca0b48 /src/cmd/pprof | |
parent | 09834d1c082a2437b12584bebaa7353377e66f1a (diff) | |
download | go-252eda470a3684a1ead5956f7e703532f4213f11.tar.gz go-252eda470a3684a1ead5956f7e703532f4213f11.zip |
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>
Diffstat (limited to 'src/cmd/pprof')
-rw-r--r-- | src/cmd/pprof/pprof.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go index 0187045b4a..5c243d2a58 100644 --- a/src/cmd/pprof/pprof.go +++ b/src/cmd/pprof/pprof.go @@ -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 } |