Skip to content

Commit

Permalink
pkg/proc/core: add error details when reading spliced memory (go-delv…
Browse files Browse the repository at this point in the history
…e#1701)

The origin error message is confusing, so add some details.

Fixes go-delve#1700
  • Loading branch information
chainhelen authored and abner-chenc committed Nov 23, 2020
1 parent 5ea6717 commit 1f7d186
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/proc/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ func (r *SplicedMemory) ReadMemory(buf []byte, addr uintptr) (n int, err error)
}
pn, err := entry.reader.ReadMemory(pb, addr)
n += pn
if err != nil || pn != len(pb) {
return n, err
if err != nil {
return n, fmt.Errorf("error while reading spliced memory at %#x: %v", addr, err)
}
if pn != len(pb) {
return n, nil
}
buf = buf[pn:]
addr += uintptr(pn)
Expand Down

0 comments on commit 1f7d186

Please sign in to comment.