本文整理匯總了Golang中cmd/internal/dwarf.DWDie.Attr方法的典型用法代碼示例。如果您正苦於以下問題:Golang DWDie.Attr方法的具體用法?Golang DWDie.Attr怎麽用?Golang DWDie.Attr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cmd/internal/dwarf.DWDie
的用法示例。
在下文中一共展示了DWDie.Attr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newattr
func newattr(die *dwarf.DWDie, attr uint16, cls int, value int64, data interface{}) *dwarf.DWAttr {
a := new(dwarf.DWAttr)
a.Link = die.Attr
die.Attr = a
a.Atr = attr
a.Cls = uint8(cls)
a.Value = value
a.Data = data
return a
}
示例2: getattr
// Each DIE (except the root ones) has at least 1 attribute: its
// name. getattr moves the desired one to the front so
// frequently searched ones are found faster.
func getattr(die *dwarf.DWDie, attr uint16) *dwarf.DWAttr {
if die.Attr.Atr == attr {
return die.Attr
}
a := die.Attr
b := a.Link
for b != nil {
if b.Atr == attr {
a.Link = b.Link
b.Link = die.Attr
die.Attr = b
return b
}
a = b
b = b.Link
}
return nil
}