The methods of compilationUnitByStartPC (used in DWARF generation)
were looking at comp unit sym.Symbols instead of loader.Sym's, which
will not be viable once the wavefront reaches DWARF gen phase two.
Rewrite the methods to use only loader.Sym.
Change-Id: I0f520399d5458079c48cff1d882ef879934f8e92
Reviewed-on: https://go-review.googlesource.com/c/go/+/222759
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
func (v compilationUnitByStartPC) Less(i, j int) bool {
switch {
- case len(v[i].Textp) == 0 && len(v[j].Textp) == 0:
+ case len(v[i].Textp2) == 0 && len(v[j].Textp2) == 0:
return v[i].Lib.Pkg < v[j].Lib.Pkg
- case len(v[i].Textp) != 0 && len(v[j].Textp) == 0:
+ case len(v[i].Textp2) != 0 && len(v[j].Textp2) == 0:
return true
- case len(v[i].Textp) == 0 && len(v[j].Textp) != 0:
+ case len(v[i].Textp2) == 0 && len(v[j].Textp2) != 0:
return false
default:
- return v[i].Textp[0].Value < v[j].Textp[0].Value
+ return v[i].PCs[0].Start < v[j].PCs[0].Start
}
}