aboutsummaryrefslogtreecommitdiff
path: root/src/debug/pe
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-03-16 14:15:54 -0700
committerIan Lance Taylor <iant@golang.org>2016-03-22 14:06:09 +0000
commitd1b8871f13203cd99d5e7d686170f0e266760084 (patch)
tree7458f93ff93d8c7b849eab786932a1682657337b /src/debug/pe
parent77f4b773e72b0840a1ce0b314cba44dff9fbaf31 (diff)
downloadgo-d1b8871f13203cd99d5e7d686170f0e266760084.tar.xz
debug/dwarf: add Reader.SeekPC and Data.Ranges
These new methods help find the compilation unit to pass to the LineReader method in order to find the line information for a PC. The Ranges method also helps identify the specific function for a PC, needed to determine the function name. This uses the .debug.ranges section if necessary, and changes the object file format packages to pass in the section contents if available. Change-Id: I5ebc3d27faaf1a126ffb17a1e6027efdf64af836 Reviewed-on: https://go-review.googlesource.com/20769 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/debug/pe')
-rw-r--r--src/debug/pe/file.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/debug/pe/file.go b/src/debug/pe/file.go
index 6adb039fd9..1acc368e1b 100644
--- a/src/debug/pe/file.go
+++ b/src/debug/pe/file.go
@@ -298,7 +298,7 @@ func (f *File) DWARF() (*dwarf.Data, error) {
// There are many other DWARF sections, but these
// are the ones the debug/dwarf package uses.
// Don't bother loading others.
- var names = [...]string{"abbrev", "info", "line", "str"}
+ var names = [...]string{"abbrev", "info", "line", "ranges", "str"}
var dat [len(names)][]byte
for i, name := range names {
name = ".debug_" + name
@@ -316,8 +316,8 @@ func (f *File) DWARF() (*dwarf.Data, error) {
dat[i] = b
}
- abbrev, info, line, str := dat[0], dat[1], dat[2], dat[3]
- return dwarf.New(abbrev, nil, nil, info, line, nil, nil, str)
+ abbrev, info, line, ranges, str := dat[0], dat[1], dat[2], dat[3], dat[4]
+ return dwarf.New(abbrev, nil, nil, info, line, nil, ranges, str)
}
// ImportedSymbols returns the names of all symbols