return &fd
}
+ state := debugState{f: f}
+
+ if loggingEnabled {
+ state.logf("generating -N reg param loc lists for func %q\n", f.Name)
+ }
+
// Allocate location lists.
fd.LocationLists = make([][]byte, numRegParams)
// loops such as that in issue 45948. In such cases, leave
// the var/slot set up for the param, but don't try to
// emit a location list.
+ if loggingEnabled {
+ state.logf("locatePrologEnd failed, skipping %v\n", n)
+ }
pidx++
continue
}
pidx++
continue
}
+ if loggingEnabled {
+ state.logf("param %v:\n [<entry>, %d]:\n", n, afterPrologVal)
+ }
rtypes, _ := inp.RegisterTypesAndOffsets()
padding := make([]uint64, 0, 32)
padding = inp.ComputePadding(padding)
list = append(list, dwarf.DW_OP_regx)
list = dwarf.AppendUleb128(list, uint64(dwreg))
}
+ if loggingEnabled {
+ state.logf(" piece %d -> dwreg %d", k, dwreg)
+ }
if len(inp.Registers) > 1 {
list = append(list, dwarf.DW_OP_piece)
ts := rtypes[k].Width
list = dwarf.AppendUleb128(list, uint64(ts))
if padding[k] > 0 {
+ if loggingEnabled {
+ state.logf(" [pad %d bytes]", padding[k])
+ }
list = append(list, dwarf.DW_OP_piece)
list = dwarf.AppendUleb128(list, padding[k])
}
}
+ if loggingEnabled {
+ state.logf("\n")
+ }
}
// fill in length of location expression element
ctxt.Arch.ByteOrder.PutUint16(list[sizeIdx:], uint16(len(list)-sizeIdx-2))
list = append(list, dwarf.DW_OP_fbreg)
list = dwarf.AppendSleb128(list, int64(soff))
}
+ if loggingEnabled {
+ state.logf(" [%d, <end>): stackOffset=%d\n", afterPrologVal, soff)
+ }
+
// fill in size
ctxt.Arch.ByteOrder.PutUint16(list[sizeIdx:], uint16(len(list)-sizeIdx-2))