arch *sys.Arch
// This maps type name string (e.g. "uintptr") to loader symbol for
- // the DWARF DIE for that type (e.g. "go.info.type.uintptr")
+ // the DWARF DIE for that type (e.g. "go:info.type.uintptr")
tmap map[string]loader.Sym
// This maps loader symbol for the DWARF DIE symbol generated for
- // a type (e.g. "go.info.uintptr") to the type symbol itself
- // ("type.uintptr").
+ // a type (e.g. "go:info.uintptr") to the type symbol itself
+ // ("type:uintptr").
// FIXME: try converting this map (and the next one) to a single
// array indexed by loader.Sym -- this may perform better.
rtmap map[loader.Sym]loader.Sym
- // This maps Go type symbol (e.g. "type.XXX") to loader symbol for
- // the typedef DIE for that type (e.g. "go.info.XXX..def")
+ // This maps Go type symbol (e.g. "type:XXX") to loader symbol for
+ // the typedef DIE for that type (e.g. "go:info.XXX..def")
tdmap map[loader.Sym]loader.Sym
// Cache these type symbols, so as to avoid repeatedly looking them up
func (d *dwctxt) walksymtypedef(symIdx loader.Sym) loader.Sym {
// We're being given the loader symbol for the type DIE, e.g.
- // "go.info.type.uintptr". Map that first to the type symbol (e.g.
- // "type.uintptr") and then to the typedef DIE for the type.
+ // "go:info.type.uintptr". Map that first to the type symbol (e.g.
+ // "type:uintptr") and then to the typedef DIE for the type.
// FIXME: this seems clunky, maybe there is a better way to do this.
if ts, ok := d.rtmap[symIdx]; ok {
}
sn := d.ldr.SymName(gotype)
- if !strings.HasPrefix(sn, "type.") {
- d.linkctxt.Errorf(gotype, "dwarf: type name doesn't start with \"type.\"")
+ if !strings.HasPrefix(sn, "type:") {
+ d.linkctxt.Errorf(gotype, "dwarf: type name doesn't start with \"type:\"")
return d.mustFind("<unspecified>")
}
name := sn[5:] // could also decode from Type.string
s := decodetypeStructFieldType(d.ldr, d.arch, gotype, i)
if f == "" {
sn := d.ldr.SymName(s)
- f = sn[5:] // skip "type."
+ f = sn[5:] // skip "type:"
}
fld := d.newdie(die, dwarf.DW_ABRV_STRUCTFIELD, f)
d.newrefattr(fld, dwarf.DW_AT_type, d.defgotype(s))
// The DWARF info synthesizes pointer types that don't exist at the
// language level, like *hash<...> and *bucket<...>, and the data
// pointers of slices. Link to the ones we can find.
- gts := d.ldr.Lookup("type."+ptrname, 0)
+ gts := d.ldr.Lookup("type:"+ptrname, 0)
if gts != 0 && d.ldr.AttrReachable(gts) {
newattr(pdie, dwarf.DW_AT_go_runtime_type, dwarf.DW_CLS_GO_TYPEREF, 0, dwSym(gts))
}
}
func (d *dwctxt) synthesizestringtypes(ctxt *Link, die *dwarf.DWDie) {
- prototype := walktypedef(d.findprotodie(ctxt, "type.runtime.stringStructDWARF"))
+ prototype := walktypedef(d.findprotodie(ctxt, "type:runtime.stringStructDWARF"))
if prototype == nil {
return
}
}
func (d *dwctxt) synthesizeslicetypes(ctxt *Link, die *dwarf.DWDie) {
- prototype := walktypedef(d.findprotodie(ctxt, "type.runtime.slice"))
+ prototype := walktypedef(d.findprotodie(ctxt, "type:runtime.slice"))
if prototype == nil {
return
}
}
func (d *dwctxt) synthesizemaptypes(ctxt *Link, die *dwarf.DWDie) {
- hash := walktypedef(d.findprotodie(ctxt, "type.runtime.hmap"))
- bucket := walktypedef(d.findprotodie(ctxt, "type.runtime.bmap"))
+ hash := walktypedef(d.findprotodie(ctxt, "type:runtime.hmap"))
+ bucket := walktypedef(d.findprotodie(ctxt, "type:runtime.bmap"))
if hash == nil {
return
}
func (d *dwctxt) synthesizechantypes(ctxt *Link, die *dwarf.DWDie) {
- sudog := walktypedef(d.findprotodie(ctxt, "type.runtime.sudog"))
- waitq := walktypedef(d.findprotodie(ctxt, "type.runtime.waitq"))
- hchan := walktypedef(d.findprotodie(ctxt, "type.runtime.hchan"))
+ sudog := walktypedef(d.findprotodie(ctxt, "type:runtime.sudog"))
+ waitq := walktypedef(d.findprotodie(ctxt, "type:runtime.waitq"))
+ hchan := walktypedef(d.findprotodie(ctxt, "type:runtime.hchan"))
if sudog == nil || waitq == nil || hchan == nil {
return
}
// symbol name here?
sn := d.ldr.SymName(rsym)
tn := sn[len(dwarf.InfoPrefix):]
- ts := d.ldr.Lookup("type."+tn, 0)
+ ts := d.ldr.Lookup("type:"+tn, 0)
d.defgotype(ts)
}
}
die := d.newdie(&dwtypes, abrv, tname)
// Look up type symbol.
- gotype := d.lookupOrDiag("type." + tname)
+ gotype := d.lookupOrDiag("type:" + tname)
// Map from die sym to type sym
ds := loader.Sym(die.Sym.(dwSym))
rsn := d.ldr.SymName(rsym)
tn := rsn[len(dwarf.InfoPrefix):]
- ts := d.ldr.Lookup("type."+tn, 0)
+ ts := d.ldr.Lookup("type:"+tn, 0)
d.defgotype(ts)
}
}
tdmap: make(map[loader.Sym]loader.Sym),
rtmap: make(map[loader.Sym]loader.Sym),
}
- d.typeRuntimeEface = d.lookupOrDiag("type.runtime.eface")
- d.typeRuntimeIface = d.lookupOrDiag("type.runtime.iface")
+ d.typeRuntimeEface = d.lookupOrDiag("type:runtime.eface")
+ d.typeRuntimeIface = d.lookupOrDiag("type:runtime.iface")
if ctxt.HeadType == objabi.Haix {
// Initial map used to store package size for each DWARF section.
newattr(die, dwarf.DW_AT_encoding, dwarf.DW_CLS_CONSTANT, dwarf.DW_ATE_unsigned, 0)
newattr(die, dwarf.DW_AT_byte_size, dwarf.DW_CLS_CONSTANT, int64(d.arch.PtrSize), 0)
newattr(die, dwarf.DW_AT_go_kind, dwarf.DW_CLS_CONSTANT, objabi.KindUintptr, 0)
- newattr(die, dwarf.DW_AT_go_runtime_type, dwarf.DW_CLS_ADDRESS, 0, dwSym(d.lookupOrDiag("type.uintptr")))
+ newattr(die, dwarf.DW_AT_go_runtime_type, dwarf.DW_CLS_ADDRESS, 0, dwSym(d.lookupOrDiag("type:uintptr")))
d.uintptrInfoSym = d.mustFind("uintptr")
// Prototypes needed for type synthesis.
prototypedies = map[string]*dwarf.DWDie{
- "type.runtime.stringStructDWARF": nil,
- "type.runtime.slice": nil,
- "type.runtime.hmap": nil,
- "type.runtime.bmap": nil,
- "type.runtime.sudog": nil,
- "type.runtime.waitq": nil,
- "type.runtime.hchan": nil,
+ "type:runtime.stringStructDWARF": nil,
+ "type:runtime.slice": nil,
+ "type:runtime.hmap": nil,
+ "type:runtime.bmap": nil,
+ "type:runtime.sudog": nil,
+ "type:runtime.waitq": nil,
+ "type:runtime.hchan": nil,
}
// Needed by the prettyprinter code for interface inspection.
for _, typ := range []string{
- "type.runtime._type",
- "type.runtime.arraytype",
- "type.runtime.chantype",
- "type.runtime.functype",
- "type.runtime.maptype",
- "type.runtime.ptrtype",
- "type.runtime.slicetype",
- "type.runtime.structtype",
- "type.runtime.interfacetype",
- "type.runtime.itab",
- "type.runtime.imethod"} {
+ "type:runtime._type",
+ "type:runtime.arraytype",
+ "type:runtime.chantype",
+ "type:runtime.functype",
+ "type:runtime.maptype",
+ "type:runtime.ptrtype",
+ "type:runtime.slicetype",
+ "type:runtime.structtype",
+ "type:runtime.interfacetype",
+ "type:runtime.itab",
+ "type:runtime.imethod"} {
d.defgotype(d.lookupOrDiag(typ))
}