github.com/pkujhd/goloader@v0.0.0-20240411034752-1a28096bd7bd/obj/inlinetree.1.9.go (about)

     1  //go:build go1.9 && !go1.12
     2  // +build go1.9,!go1.12
     3  
     4  package obj
     5  
     6  import (
     7  	"cmd/objfile/goobj"
     8  )
     9  
    10  func initInline(objFunc *goobj.Func, Func *FuncInfo, pkgpath string, fd *readAtSeeker) (err error) {
    11  	for _, inl := range objFunc.InlTree {
    12  		inline := InlTreeNode{
    13  			Parent:   int64(inl.Parent),
    14  			File:     inl.File,
    15  			Line:     int64(inl.Line),
    16  			Func:     inl.Func.Name,
    17  			ParentPC: 0,
    18  		}
    19  		inline.Func = ReplacePkgPath(inline.Func, pkgpath)
    20  		Func.InlTree = append(Func.InlTree, inline)
    21  	}
    22  	Func.PCInline, err = fd.BytesAt(objFunc.PCInline.Offset, objFunc.PCInline.Size)
    23  	return err
    24  }