本文整理匯總了Golang中cmd/internal/dwarf.DWDie.Abbrev方法的典型用法代碼示例。如果您正苦於以下問題:Golang DWDie.Abbrev方法的具體用法?Golang DWDie.Abbrev怎麽用?Golang DWDie.Abbrev使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cmd/internal/dwarf.DWDie
的用法示例。
在下文中一共展示了DWDie.Abbrev方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newdie
// Every DIE has at least a AT_name attribute (but it will only be
// written out if it is listed in the abbrev).
func newdie(ctxt *Link, parent *dwarf.DWDie, abbrev int, name string, version int) *dwarf.DWDie {
die := new(dwarf.DWDie)
die.Abbrev = abbrev
die.Link = parent.Child
parent.Child = die
newattr(die, dwarf.DW_AT_name, dwarf.DW_CLS_STRING, int64(len(name)), name)
if name != "" && (abbrev <= dwarf.DW_ABRV_VARIABLE || abbrev >= dwarf.DW_ABRV_NULLTYPE) {
if abbrev != dwarf.DW_ABRV_VARIABLE || version == 0 {
sym := Linklookup(ctxt, dwarf.InfoPrefix+name, version)
sym.Attr |= AttrHidden
sym.Type = obj.SDWARFINFO
die.Sym = sym
}
}
return die
}