aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go
diff options
context:
space:
mode:
authorEmmanuel T Odeke <emmanuel@orijtech.com>2021-02-26 02:27:24 -0800
committerEmmanuel Odeke <emmanuel@orijtech.com>2021-03-15 19:02:39 +0000
commit2d4042d4ab3a2021819dce91eb228daf8fa5e557 (patch)
tree0a0b71f4bc2859a19320760f54be55f891b5e07a /src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go
parenta8d9fb2fcd1fc11b41651e0ea608b3a3e90755b7 (diff)
downloadgo-2d4042d4ab3a2021819dce91eb228daf8fa5e557.tar.xz
all: update golang.org/x/* dependencies
Updates src/ and src/cmd/* dependencies, using go mod vendor as well as updatestd -branch=master -goroot=$GOROOT This change was ran in anticipation of bringing in x/net/http2 CL 237957. For #32112. For #36905. Change-Id: If8cefc348463b6d82d85020b57db411213720ef8 Reviewed-on: https://go-review.googlesource.com/c/go/+/296789 Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Dmitri Shuralyov <dmitshur@golang.org> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
Diffstat (limited to 'src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go b/src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go
index c0661bf4aa..0c702398d3 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/binutils/addr2liner.go
@@ -70,7 +70,11 @@ func (a *addr2LinerJob) write(s string) error {
}
func (a *addr2LinerJob) readLine() (string, error) {
- return a.out.ReadString('\n')
+ s, err := a.out.ReadString('\n')
+ if err != nil {
+ return "", err
+ }
+ return strings.TrimSpace(s), nil
}
// close releases any resources used by the addr2liner object.
@@ -115,19 +119,11 @@ func newAddr2Liner(cmd, file string, base uint64) (*addr2Liner, error) {
return a, nil
}
-func (d *addr2Liner) readString() (string, error) {
- s, err := d.rw.readLine()
- if err != nil {
- return "", err
- }
- return strings.TrimSpace(s), nil
-}
-
// readFrame parses the addr2line output for a single address. It
// returns a populated plugin.Frame and whether it has reached the end of the
// data.
func (d *addr2Liner) readFrame() (plugin.Frame, bool) {
- funcname, err := d.readString()
+ funcname, err := d.rw.readLine()
if err != nil {
return plugin.Frame{}, true
}
@@ -135,12 +131,12 @@ func (d *addr2Liner) readFrame() (plugin.Frame, bool) {
// If addr2line returns a hex address we can assume it is the
// sentinel. Read and ignore next two lines of output from
// addr2line
- d.readString()
- d.readString()
+ d.rw.readLine()
+ d.rw.readLine()
return plugin.Frame{}, true
}
- fileline, err := d.readString()
+ fileline, err := d.rw.readLine()
if err != nil {
return plugin.Frame{}, true
}
@@ -186,7 +182,7 @@ func (d *addr2Liner) rawAddrInfo(addr uint64) ([]plugin.Frame, error) {
return nil, err
}
- resp, err := d.readString()
+ resp, err := d.rw.readLine()
if err != nil {
return nil, err
}