Lines Matching full:ctxt
269 func Uleb128put(ctxt Context, s Sym, v int64) {
275 ctxt.AddBytes(s, b)
279 func Sleb128put(ctxt Context, s Sym, v int64) {
285 ctxt.AddBytes(s, b)
831 func putattr(ctxt Context, s Sym, abbrev int, form int, cls int, value int64, data interface{}) error {
834 ctxt.AddAddress(s, data, value)
838 ctxt.AddInt(s, 1, int64(1+ctxt.PtrSize()))
839 ctxt.AddInt(s, 1, DW_OP_addr)
840 ctxt.AddAddress(s, data, 0)
845 ctxt.AddInt(s, 1, value)
847 ctxt.AddBytes(s, p)
852 ctxt.AddInt(s, 2, value)
854 ctxt.AddBytes(s, p)
859 ctxt.AddInt(s, 4, value)
861 ctxt.AddBytes(s, p)
864 Uleb128put(ctxt, s, value)
867 ctxt.AddBytes(s, p)
870 ctxt.AddInt(s, 1, value)
873 ctxt.AddInt(s, 2, value)
877 ctxt.AddSectionOffset(s, 4, data, value)
880 ctxt.AddInt(s, 4, value)
883 ctxt.AddInt(s, 8, value)
886 Sleb128put(ctxt, s, value)
889 Uleb128put(ctxt, s, value)
893 ctxt.AddString(s, str)
896 ctxt.AddInt(s, 1, 0)
901 ctxt.AddInt(s, 1, 1)
903 ctxt.AddInt(s, 1, 0)
914 ctxt.AddSectionOffset(s, 4, data, value)
935 func PutAttrs(ctxt Context, s Sym, abbrev int, attr *DWAttr) {
940 putattr(ctxt, s, abbrev, int(f.form), int(ap.Cls), ap.Value, ap.Data)
945 putattr(ctxt, s, abbrev, int(f.form), 0, 0, nil)
955 func PutIntConst(ctxt Context, info, typ Sym, name string, val int64) {
956 Uleb128put(ctxt, info, DW_ABRV_INT_CONSTANT)
957 putattr(ctxt, info, DW_ABRV_INT_CONSTANT, DW_FORM_string, DW_CLS_STRING, int64(len(name)), name)
958 putattr(ctxt, info, DW_ABRV_INT_CONSTANT, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, typ)
959 putattr(ctxt, info, DW_ABRV_INT_CONSTANT, DW_FORM_sdata, DW_CLS_CONSTANT, val, nil)
967 func PutRanges(ctxt Context, sym Sym, base Sym, ranges []Range) {
968 ps := ctxt.PtrSize()
975 ctxt.AddInt(sym, ps, r.Start)
976 ctxt.AddInt(sym, ps, r.End)
978 ctxt.AddCURelativeAddress(sym, base, r.Start)
979 ctxt.AddCURelativeAddress(sym, base, r.End)
983 ctxt.AddInt(sym, ps, 0)
984 ctxt.AddInt(sym, ps, 0)
1046 func putPrunedScopes(ctxt Context, s *FnState, fnabbrev int) error {
1064 if putscope(ctxt, s, scopes, 0, fnabbrev, encbuf[:0]) < int32(len(scopes)) {
1077 func PutAbstractFunc(ctxt Context, s *FnState) error {
1080 ctxt.Logf("PutAbstractFunc(%v)\n", s.Absfn)
1084 Uleb128put(ctxt, s.Absfn, int64(abbrev))
1097 putattr(ctxt, s.Absfn, abbrev, DW_FORM_string, DW_CLS_STRING, int64(len(fullname)), fullname)
1100 putattr(ctxt, s.Absfn, abbrev, DW_FORM_data1, DW_CLS_CONSTANT, int64(DW_INL_inlined), nil)
1106 putattr(ctxt, s.Absfn, abbrev, DW_FORM_flag, DW_CLS_FLAG, ev, 0)
1134 ctxt.Logf("putAbstractScope(%v): vars:", s.Info)
1136 ctxt.Logf(" %d:%s", i, v.Name)
1138 ctxt.Logf("\n")
1145 offsets = append(offsets, int32(ctxt.CurrentOffset(s.Absfn)))
1146 putAbstractVar(ctxt, s.Absfn, v)
1150 ctxt.RecordChildDieOffsets(s.Absfn, flattened, offsets)
1152 Uleb128put(ctxt, s.Absfn, 0)
1161 func PutInlinedFunc(ctxt Context, s *FnState, callersym Sym, callIdx int) error {
1169 Uleb128put(ctxt, s.Info, int64(abbrev))
1172 ctxt.Logf("PutInlinedFunc(caller=%v,callee=%v,abbrev=%d)\n", callersym, callee, abbrev)
1176 putattr(ctxt, s.Info, abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, callee)
1179 putattr(ctxt, s.Info, abbrev, DW_FORM_sec_offset, DW_CLS_PTR, s.Ranges.Len(), s.Ranges)
1180 PutRanges(ctxt, s.Ranges, s.StartPC, ic.Ranges)
1184 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, st, s.StartPC)
1185 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, en, s.StartPC)
1189 ctxt.AddFileRef(s.Info, ic.CallFile)
1190 putattr(ctxt, s.Info, abbrev, DW_FORM_udata, DW_CLS_CONSTANT, int64(ic.CallLine), nil)
1201 putvar(ctxt, s, v, callee, abbrev, inlIndex, encbuf[:0])
1207 err := PutInlinedFunc(ctxt, s, absfn, sib)
1213 Uleb128put(ctxt, s.Info, 0)
1224 func PutConcreteFunc(ctxt Context, s *FnState) error {
1226 ctxt.Logf("PutConcreteFunc(%v)\n", s.Info)
1229 Uleb128put(ctxt, s.Info, int64(abbrev))
1232 putattr(ctxt, s.Info, abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, s.Absfn)
1235 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, 0, s.StartPC)
1236 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, s.Size, s.StartPC)
1239 putattr(ctxt, s.Info, abbrev, DW_FORM_block1, DW_CLS_BLOCK, 1, []byte{DW_OP_call_frame_cfa})
1242 if err := putPrunedScopes(ctxt, s, abbrev); err != nil {
1249 err := PutInlinedFunc(ctxt, s, absfn, sib)
1255 Uleb128put(ctxt, s.Info, 0)
1264 func PutDefaultFunc(ctxt Context, s *FnState) error {
1266 ctxt.Logf("PutDefaultFunc(%v)\n", s.Info)
1269 Uleb128put(ctxt, s.Info, int64(abbrev))
1271 putattr(ctxt, s.Info, DW_ABRV_FUNCTION, DW_FORM_string, DW_CLS_STRING, int64(len(s.Name)), s.Name)
1272 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, 0, s.StartPC)
1273 putattr(ctxt, s.Info, abbrev, DW_FORM_addr, DW_CLS_ADDRESS, s.Size, s.StartPC)
1274 putattr(ctxt, s.Info, abbrev, DW_FORM_block1, DW_CLS_BLOCK, 1, []byte{DW_OP_call_frame_cfa})
1275 ctxt.AddFileRef(s.Info, s.Filesym)
1281 putattr(ctxt, s.Info, abbrev, DW_FORM_flag, DW_CLS_FLAG, ev, 0)
1284 if err := putPrunedScopes(ctxt, s, abbrev); err != nil {
1291 err := PutInlinedFunc(ctxt
1297 Uleb128put(ctxt, s.Info, 0)
1301 func putscope(ctxt Context, s *FnState, scopes []Scope, curscope int32, fnabbrev int, encbuf []byte) int32 {
1304 ctxt.Logf("putscope(%v,%d): vars:", s.Info, curscope)
1306 ctxt.Logf(" %d:%d:%s", i, v.ChildIndex, v.Name)
1308 ctxt.Logf("\n")
1312 putvar(ctxt, s, v, s.Absfn, fnabbrev, -1, encbuf)
1323 Uleb128put(ctxt, s.Info, DW_ABRV_LEXICAL_BLOCK_SIMPLE)
1324 putattr(ctxt, s.Info, DW_ABRV_LEXICAL_BLOCK_SIMPLE, DW_FORM_addr, DW_CLS_ADDRESS, scope.Ranges[0].Start, s.StartPC)
1325 putattr(ctxt, s.Info, DW_ABRV_LEXICAL_BLOCK_SIMPLE, DW_FORM_addr, DW_CLS_ADDRESS, scope.Ranges[0].End, s.StartPC)
1327 Uleb128put(ctxt, s.Info, DW_ABRV_LEXICAL_BLOCK_RANGES)
1328 putattr(ctxt, s.Info, DW_ABRV_LEXICAL_BLOCK_RANGES, DW_FORM_sec_offset, DW_CLS_PTR, s.Ranges.Len(), s.Ranges)
1330 PutRanges(ctxt, s.Ranges, s.StartPC, scope.Ranges)
1333 curscope = putscope(ctxt, s, scopes, curscope, fnabbrev, encbuf)
1334 Uleb128put(ctxt, s.Info, 0)
1408 func putAbstractVar(ctxt Context, info Sym, v *Var) {
1418 Uleb128put(ctxt, info, int64(abbrev))
1419 putattr(ctxt, info, abbrev, DW_FORM_string, DW_CLS_STRING, int64(len(v.Name)), v.Name)
1427 putattr(ctxt, info, abbrev, DW_FORM_flag, DW_CLS_FLAG, isReturn, nil)
1433 putattr(ctxt, info, abbrev, DW_FORM_udata, DW_CLS_CONSTANT, int64(v.DeclLine), nil)
1437 putattr(ctxt, info, abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, v.Type)
1442 func putvar(ctxt Context, s *FnState, v *Var, absfn Sym, fnabbrev, inlIndex int, encbuf []byte) {
1446 Uleb128put(ctxt, s.Info, int64(abbrev))
1454 putattr(ctxt, s.Info, abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, absfn)
1455 ctxt.RecordDclReference(s.Info, absfn, int(v.ChildIndex), inlIndex)
1459 putattr(ctxt, s.Info, abbrev, DW_FORM_string, DW_CLS_STRING, int64(len(n)), n)
1465 putattr(ctxt, s.Info, abbrev, DW_FORM_flag, DW_CLS_FLAG, isReturn, nil)
1467 putattr(ctxt, s.Info, abbrev, DW_FORM_udata, DW_CLS_CONSTANT, int64(v.DeclLine), nil)
1468 putattr(ctxt, s.Info, abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, v.Type)
1472 putattr(ctxt, s.Info, abbrev, DW_FORM_sec_offset, DW_CLS_PTR, int64(s.Loc.Len()), s.Loc)
1473 addLocList(ctxt, s.Loc, s.StartPC, v, encbuf)
1485 putattr(ctxt, s.Info, abbrev, DW_FORM_block1, DW_CLS_BLOCK, int64(len(loc)), loc)
1491 func addLocList(ctxt Context, listSym, startPC Sym, v *Var, encbuf []byte) {
1493 ctxt.AddInt(listSym, ctxt.PtrSize(), ^0)
1494 ctxt.AddAddress(listSym, startPC, 0)
1496 ctxt.AddInt(listSym, ctxt.PtrSize(), entry.StartPC)
1497 ctxt.AddInt(listSym, ctxt.PtrSize(), entry.EndPC)
1522 ctxt.AddInt(listSym, 2, int64(len(locBuf)))
1523 ctxt.AddBytes(listSym, locBuf)
1526 ctxt.AddInt(listSym, ctxt.PtrSize(), 0)
1527 ctxt.AddInt(listSym, ctxt.PtrSize(), 0)