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

     1  //go:build go1.12 && !go1.20
     2  // +build go1.12,!go1.20
     3  
     4  package obj
     5  
     6  type funcID uint8
     7  
     8  // inlinedCall is the encoding of entries in the FUNCDATA_InlTree table.
     9  type InlinedCall struct {
    10  	parent   int16  // index of parent in the inltree, or < 0
    11  	funcID   funcID // type of the called function
    12  	_        byte
    13  	file     int32 // fileno index into filetab
    14  	line     int32 // line number of the call site
    15  	func_    int32 // offset into pclntab for name of called function
    16  	parentPc int32 // position of an instruction whose source position is the call site (offset from entry)
    17  }
    18  
    19  func InitInlinedCall(inl InlTreeNode, funcid uint8, namemap map[string]int, filetab []uint32) InlinedCall {
    20  	return InlinedCall{
    21  		parent:   int16(inl.Parent),
    22  		funcID:   funcID(funcid),
    23  		file:     FindFileTab(inl.File, namemap, filetab),
    24  		line:     int32(inl.Line),
    25  		func_:    int32(namemap[inl.Func]),
    26  		parentPc: int32(inl.ParentPC)}
    27  }