]> Cypherpunks repositories - gostls13.git/commitdiff
debug/macho, debug/pe: load DWARF line section and pass to dwarf.New
authorAustin Clements <austin@google.com>
Fri, 6 Mar 2015 16:05:46 +0000 (11:05 -0500)
committerAustin Clements <austin@google.com>
Tue, 10 Mar 2015 02:32:31 +0000 (02:32 +0000)
Change-Id: I1e6c6b3e2984528c0331e17755cc057e7199193e
Reviewed-on: https://go-review.googlesource.com/7071
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/debug/macho/file.go
src/debug/pe/file.go

index eefb74444265b1007a497424ee9a31f6d85c6efd..a7599aa5b2b13922956259a62ecaab5e28207387 100644 (file)
@@ -472,9 +472,9 @@ func (f *File) Section(name string) *Section {
 // DWARF returns the DWARF debug information for the Mach-O file.
 func (f *File) DWARF() (*dwarf.Data, error) {
        // There are many other DWARF sections, but these
-       // are the required ones, and the debug/dwarf package
-       // does not use the others, so don't bother loading them.
-       var names = [...]string{"abbrev", "info", "str"}
+       // are the ones the debug/dwarf package uses.
+       // Don't bother loading others.
+       var names = [...]string{"abbrev", "info", "line", "str"}
        var dat [len(names)][]byte
        for i, name := range names {
                name = "__debug_" + name
@@ -489,8 +489,8 @@ func (f *File) DWARF() (*dwarf.Data, error) {
                dat[i] = b
        }
 
-       abbrev, info, str := dat[0], dat[1], dat[2]
-       return dwarf.New(abbrev, nil, nil, info, nil, nil, nil, str)
+       abbrev, info, line, str := dat[0], dat[1], dat[2], dat[3]
+       return dwarf.New(abbrev, nil, nil, info, line, nil, nil, str)
 }
 
 // ImportedSymbols returns the names of all symbols
index 759e5674fd623de32fcf6e8d8c523179d86492f4..844dffc88817c6aef9bb4723023633f280e6f5c2 100644 (file)
@@ -296,9 +296,9 @@ func (f *File) Section(name string) *Section {
 
 func (f *File) DWARF() (*dwarf.Data, error) {
        // There are many other DWARF sections, but these
-       // are the required ones, and the debug/dwarf package
-       // does not use the others, so don't bother loading them.
-       var names = [...]string{"abbrev", "info", "str"}
+       // are the ones the debug/dwarf package uses.
+       // Don't bother loading others.
+       var names = [...]string{"abbrev", "info", "line", "str"}
        var dat [len(names)][]byte
        for i, name := range names {
                name = ".debug_" + name
@@ -313,8 +313,8 @@ func (f *File) DWARF() (*dwarf.Data, error) {
                dat[i] = b
        }
 
-       abbrev, info, str := dat[0], dat[1], dat[2]
-       return dwarf.New(abbrev, nil, nil, info, nil, nil, nil, str)
+       abbrev, info, line, str := dat[0], dat[1], dat[2], dat[3]
+       return dwarf.New(abbrev, nil, nil, info, line, nil, nil, str)
 }
 
 // ImportedSymbols returns the names of all symbols