Skip to content

Commit

Permalink
Make isData field specific to fileAddr2Line. (google#614)
Browse files Browse the repository at this point in the history
The fileNM structure does not need it as NM symbolization does not use the field.
  • Loading branch information
aalexand authored Mar 23, 2021
1 parent 15ff72e commit b188cf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/binutils/binutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ func (b *binrep) openELF(name string, start, limit, offset uint64) (plugin.ObjFi
buildID = fmt.Sprintf("%x", id)
}
}
isData := ph != nil && ph.Flags&elf.PF_X == 0
if b.fast || (!b.addr2lineFound && !b.llvmSymbolizerFound) {
return &fileNM{file: file{b, name, base, buildID, isData}}, nil
return &fileNM{file: file{b, name, base, buildID}}, nil
}
return &fileAddr2Line{file: file{b, name, base, buildID, isData}}, nil
isData := ph != nil && ph.Flags&elf.PF_X == 0
return &fileAddr2Line{file: file{b, name, base, buildID}, isData: isData}, nil
}

func (b *binrep) openPE(name string, start, limit, offset uint64) (plugin.ObjFile, error) {
Expand Down Expand Up @@ -517,7 +517,6 @@ type file struct {
name string
base uint64
buildID string
isData bool
}

func (f *file) Name() string {
Expand Down Expand Up @@ -579,6 +578,7 @@ type fileAddr2Line struct {
file
addr2liner *addr2Liner
llvmSymbolizer *llvmSymbolizer
isData bool
}

func (f *fileAddr2Line) SourceLine(addr uint64) ([]plugin.Frame, error) {
Expand Down

0 comments on commit b188cf6

Please sign in to comment.