Commit 29ad1ae4 authored by Austin Clements's avatar Austin Clements

debug/elf: load .debug_line section and pass to dwarf.New

Change-Id: Ia6f9bd77a3d4250339dcb054edc76942864dd358
Reviewed-on: https://go-review.googlesource.com/6781Reviewed-by: default avatarRob Pike <r@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 4ee347b0
...@@ -749,9 +749,9 @@ func (f *File) DWARF() (*dwarf.Data, error) { ...@@ -749,9 +749,9 @@ func (f *File) DWARF() (*dwarf.Data, error) {
} }
// There are many other DWARF sections, but these // There are many other DWARF sections, but these
// are the required ones, and the debug/dwarf package // are the ones the debug/dwarf package uses.
// does not use the others, so don't bother loading them. // Don't bother loading others.
var dat = map[string][]byte{"abbrev": nil, "info": nil, "str": nil} var dat = map[string][]byte{"abbrev": nil, "info": nil, "str": nil, "line": nil}
for i, s := range f.Sections { for i, s := range f.Sections {
if !strings.HasPrefix(s.Name, ".debug_") { if !strings.HasPrefix(s.Name, ".debug_") {
continue continue
...@@ -766,7 +766,7 @@ func (f *File) DWARF() (*dwarf.Data, error) { ...@@ -766,7 +766,7 @@ func (f *File) DWARF() (*dwarf.Data, error) {
dat[s.Name[7:]] = b dat[s.Name[7:]] = b
} }
d, err := dwarf.New(dat["abbrev"], nil, nil, dat["info"], nil, nil, nil, dat["str"]) d, err := dwarf.New(dat["abbrev"], nil, nil, dat["info"], dat["line"], nil, nil, dat["str"])
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment