Skip to content

Commit

Permalink
Reverting commits 82f4cfd, d0f297e, 0d5caca -- wrong branch
Browse files Browse the repository at this point in the history
  • Loading branch information
brigadier-general authored Jun 10, 2024
1 parent 82f4cfd commit 5398a6a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions objfile/objfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type StompMagicCandidate struct {
type PclntabCandidate struct {
SecStart uint64
PclntabVA uint64
GofuncVA uint64
StompMagicCandidateMeta *StompMagicCandidate // some search modes might optimistically try to find moduledata or guess endianess, these hints must match the found moduleData VA later to be considered good candidate
Pclntab []byte
Symtab []byte // optional
Expand Down Expand Up @@ -130,8 +129,8 @@ func (f *File) Symbols() ([]Sym, error) {
}

// previously : func (f *File) PCLineTable() (Liner, error) {
func (f *File) PCLineTable(versionOverride string, knownPclntabVA uint64, knownGoTextBase uint64, knownGofuncVA uint64) ([]PclntabCandidate, error) {
return f.entries[0].PCLineTable(versionOverride, knownPclntabVA, knownGoTextBase, knownGofuncVA)
func (f *File) PCLineTable(versionOverride string, knownPclntabVA uint64, knownGoTextBase uint64) ([]PclntabCandidate, error) {
return f.entries[0].PCLineTable(versionOverride, knownPclntabVA, knownGoTextBase)
}

func (f *File) ModuleDataTable(pclntabVA uint64, runtimeVersion string, version string, is64bit bool, littleendian bool) (secStart uint64, moduleData *ModuleData, err error) {
Expand Down Expand Up @@ -212,7 +211,7 @@ func findAllOccurrences(data []byte, searches [][]byte) []int {
}

// previously: func (e *Entry) PCLineTable() (Liner, error)
func (e *Entry) PCLineTable(versionOverride string, knownPclntabVA uint64, knownGoTextBase uint64, knownGofuncVa uint64) ([]PclntabCandidate, error) {
func (e *Entry) PCLineTable(versionOverride string, knownPclntabVA uint64, knownGoTextBase uint64) ([]PclntabCandidate, error) {
// If the raw file implements Liner directly, use that.
// Currently, only Go intermediate objects and archives (goobj) use this path.

Expand Down Expand Up @@ -252,11 +251,7 @@ func (e *Entry) PCLineTable(versionOverride string, knownPclntabVA uint64, known
continue
}

if knownGofuncVA != 0 {
candidate.Gofunc = knownGofuncVA
}

parsedTable, err := gosym.NewTable(candidate.Symtab, gosym.NewLineTable(candidate.Pclntab, candidate.SecStart, candidate.Gofunc), versionOverride)
parsedTable, err := gosym.NewTable(candidate.Symtab, gosym.NewLineTable(candidate.Pclntab, candidate.SecStart), versionOverride)
if err != nil || parsedTable.Go12line == nil {
continue
}
Expand Down

0 comments on commit 5398a6a

Please sign in to comment.