Lines Matching +full:mem +full:- +full:base

59  *  1. Empty enums - GCC will occasionally emit an enum without any members.
68 * 2. Forward declarations - If the compiler sees a forward declaration for
72 * forward-referencing tdescs to the actual struct/union definitions. This
114 * To reduce the staggering amount of error-handling code that would otherwise
115 * be required, the attribute-retrieval routines handle most of their own
146 return (++dw->dw_mfgtid_last); in mfgtid_next()
152 hash_add(dw->dw_tidhash, tdp); in tdesc_add()
163 if (hash_find(dw->dw_tidhash, &tmpl, &tdp)) in tdesc_lookup()
177 switch (tdp->t_type) { in tdesc_size()
185 return (tdp->t_size); in tdesc_size()
194 tdp = tdp->t_tdesc; in tdesc_size()
202 tdp->t_id, tdp->t_type); in tdesc_size()
211 switch (tdp->t_type) { in tdesc_bitsize()
213 return (tdp->t_intr->intr_nbits); in tdesc_bitsize()
221 return (tdp->t_size * NBBY); in tdesc_bitsize()
230 tdp = tdp->t_tdesc; in tdesc_bitsize()
238 tdp->t_id, tdp->t_type); in tdesc_bitsize()
247 switch (tdp->t_type) { in tdesc_basetype()
252 tdp = tdp->t_tdesc; in tdesc_basetype()
267 if (dwarf_dieoffset(die, &off, &dw->dw_err) == DW_DLV_OK) in die_off()
271 dwarf_errmsg(dw->dw_err)); in die_off()
282 if ((rc = dwarf_siblingof(dw->dw_dw, die, &sib, &dw->dw_err)) == in die_sibling()
289 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_sibling()
300 if ((rc = dwarf_child(die, &child, &dw->dw_err)) == DW_DLV_OK) in die_child()
306 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_child()
316 if (dwarf_tag(die, &tag, &dw->dw_err) == DW_DLV_OK) in die_tag()
320 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_tag()
331 if ((rc = dwarf_attr(die, name, &attr, &dw->dw_err)) == DW_DLV_OK) { in die_attr()
343 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_attr()
353 if (dwarf_attrval_signed(die, name, valp, &dw->dw_err) != DW_DLV_OK) { in die_signed()
356 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_signed()
368 if (dwarf_attrval_unsigned(die, name, valp, &dw->dw_err) != DW_DLV_OK) { in die_unsigned()
371 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_unsigned()
383 if (dwarf_attrval_flag(die, name, valp, &dw->dw_err) != DW_DLV_OK) { in die_bool()
386 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_bool()
398 if (dwarf_attrval_string(die, name, &str, &dw->dw_err) != DW_DLV_OK || in die_string()
402 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_string()
417 if (dwarf_attrval_unsigned(die, name, &off, &dw->dw_err) != DW_DLV_OK) { in die_attr_ref()
419 die_off(dw, die), dwarf_errmsg(dw->dw_err)); in die_attr_ref()
466 tdp->t_id = off; in die_add()
501 if (dwarf_whatform(at, &form, &dw->dw_err) != DW_DLV_OK) in die_mem_offset()
511 * GCC in base and Clang (3.3 or below) generates in die_mem_offset()
516 if (dwarf_loclist(at, &loc, &locnum, &dw->dw_err) != DW_DLV_OK) in die_mem_offset()
518 if (locnum != 1 || loc->ld_s->lr_atom != DW_OP_plus_uconst) { in die_mem_offset()
523 *valp = loc->ld_s->lr_number; in die_mem_offset()
525 dwarf_dealloc(dw->dw_dw, loc->ld_s, DW_DLA_LOC_BLOCK); in die_mem_offset()
526 dwarf_dealloc(dw->dw_dw, loc, DW_DLA_LOCDESC); in die_mem_offset()
544 * base won't emit DW_FORM_data[48] for this attribute. This in die_mem_offset()
549 if (dwarf_attrval_unsigned(die, name, valp, &dw->dw_err) != in die_mem_offset()
569 intr->intr_type = INTR_INT; in tdesc_intr_common()
570 intr->intr_signed = 1; in tdesc_intr_common()
571 intr->intr_nbits = sz * NBBY; in tdesc_intr_common()
574 tdp->t_name = xstrdup(name); in tdesc_intr_common()
575 tdp->t_size = sz; in tdesc_intr_common()
576 tdp->t_id = tid; in tdesc_intr_common()
577 tdp->t_type = INTRINSIC; in tdesc_intr_common()
578 tdp->t_intr = intr; in tdesc_intr_common()
579 tdp->t_flags = TDESC_F_RESOLVED; in tdesc_intr_common()
587 * Manufacture a void type. Used for gcc-emitted stabs, where the lack of a
592 * would then be a duplicate, but it'll be removed in the self-uniquification
593 * merge performed at the completion of DWARF->tdesc conversion.
598 if (dw->dw_void == NULL) in tdesc_intr_void()
599 dw->dw_void = tdesc_intr_common(dw, TID_VOID, "void", 0); in tdesc_intr_void()
601 return (dw->dw_void); in tdesc_intr_void()
607 if (dw->dw_long == NULL) { in tdesc_intr_long()
608 dw->dw_long = tdesc_intr_common(dw, TID_LONG, "long", in tdesc_intr_long()
609 dw->dw_ptrsz); in tdesc_intr_long()
612 return (dw->dw_long); in tdesc_intr_long()
625 if (!(old->t_flags & TDESC_F_RESOLVED)) { in tdesc_intr_clone()
627 "unresolved type\n", old->t_id); in tdesc_intr_clone()
630 xasprintf(&new->t_name, "%s %s", old->t_name, suffix); in tdesc_intr_clone()
631 new->t_size = old->t_size; in tdesc_intr_clone()
632 new->t_id = mfgtid_next(dw); in tdesc_intr_clone()
633 new->t_type = INTRINSIC; in tdesc_intr_clone()
634 new->t_flags = TDESC_F_RESOLVED; in tdesc_intr_clone()
636 new->t_intr = xcalloc(sizeof (intr_t)); in tdesc_intr_clone()
637 bcopy(old->t_intr, new->t_intr, sizeof (intr_t)); in tdesc_intr_clone()
638 new->t_intr->intr_nbits = bitsz; in tdesc_intr_clone()
659 ctdp->t_id = mfgtid_next(dw); in tdesc_array_create()
660 debug(3, "die %llu: creating new type %u for sub-dimension\n", in tdesc_array_create()
661 die_off(dw, dim2), ctdp->t_id); in tdesc_array_create()
664 terminate("die %llu: unexpected non-subrange node in array\n", in tdesc_array_create()
668 dimtdp->t_type = ARRAY; in tdesc_array_create()
669 dimtdp->t_ardef = ar = xcalloc(sizeof (ardef_t)); in tdesc_array_create()
683 ar->ad_nelems = uval + 1; in tdesc_array_create()
685 ar->ad_nelems = sval + 1; in tdesc_array_create()
687 ar->ad_nelems = uval; in tdesc_array_create()
689 ar->ad_nelems = sval; in tdesc_array_create()
691 ar->ad_nelems = 0; in tdesc_array_create()
697 ar->ad_idxtype = tdesc_intr_long(dw); in tdesc_array_create()
698 ar->ad_contents = ctdp; in tdesc_array_create()
700 if (ar->ad_contents->t_size != 0) { in tdesc_array_create()
701 dimtdp->t_size = ar->ad_contents->t_size * ar->ad_nelems; in tdesc_array_create()
702 dimtdp->t_flags |= TDESC_F_RESOLVED; in tdesc_array_create()
730 tdp->t_size = uval; in die_array_create()
733 * Ensure that sub-dimensions have sizes too before marking in die_array_create()
737 for (dimtdp = tdp->t_ardef->ad_contents; in die_array_create()
738 dimtdp->t_type == ARRAY; in die_array_create()
739 dimtdp = dimtdp->t_ardef->ad_contents) { in die_array_create()
740 if (!(dimtdp->t_flags & TDESC_F_RESOLVED)) { in die_array_create()
746 tdp->t_flags |= flags; in die_array_create()
750 tdp->t_ardef->ad_nelems, tdp->t_size); in die_array_create()
760 if (tdp->t_flags & TDESC_F_RESOLVED) in die_array_resolve()
763 debug(3, "trying to resolve array %d (cont %d)\n", tdp->t_id, in die_array_resolve()
764 tdp->t_ardef->ad_contents->t_id); in die_array_resolve()
766 if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0 && in die_array_resolve()
767 (tdp->t_ardef->ad_contents->t_flags & TDESC_F_RESOLVED) == 0) { in die_array_resolve()
769 tdesc_name(tdp), tdp->t_id, in die_array_resolve()
770 tdp->t_ardef->ad_contents->t_id); in die_array_resolve()
772 dw->dw_nunres++; in die_array_resolve()
776 tdp->t_size = sz * tdp->t_ardef->ad_nelems; in die_array_resolve()
777 tdp->t_flags |= TDESC_F_RESOLVED; in die_array_resolve()
779 debug(3, "resolved array %d: %u bytes\n", tdp->t_id, tdp->t_size); in die_array_resolve()
788 tdesc_t *cont = tdp->t_ardef->ad_contents; in die_array_failed()
790 if (tdp->t_flags & TDESC_F_RESOLVED) in die_array_failed()
794 tdp->t_id, tdesc_name(cont), cont->t_id); in die_array_failed()
801 * Others - those without members (see the file comment) - won't be, and will
808 Dwarf_Die mem; in die_enum_create() local
813 tdp->t_type = FORWARD; in die_enum_create()
819 tdp->t_type = ENUM; in die_enum_create()
822 tdp->t_size = uval; in die_enum_create()
824 if ((mem = die_child(dw, die)) != NULL) { in die_enum_create()
825 elist_t **elastp = &tdp->t_emem; in die_enum_create()
830 if (die_tag(dw, mem) != DW_TAG_enumerator) { in die_enum_create()
832 die_create_one(dw, mem); in die_enum_create()
837 el->el_name = die_name(dw, mem); in die_enum_create()
839 if (die_signed(dw, mem, DW_AT_const_value, &sval, 0)) { in die_enum_create()
840 el->el_number = sval; in die_enum_create()
841 } else if (die_unsigned(dw, mem, DW_AT_const_value, in die_enum_create()
843 el->el_number = uval; in die_enum_create()
846 "value\n", off, die_off(dw, mem)); in die_enum_create()
850 die_off(dw, mem), el->el_name, el->el_number); in die_enum_create()
853 elastp = &el->el_next; in die_enum_create()
855 } while ((mem = die_sibling(dw, mem)) != NULL); in die_enum_create()
857 hash_add(dw->dw_enumhash, tdp); in die_enum_create()
859 tdp->t_flags |= TDESC_F_RESOLVED; in die_enum_create()
861 if (tdp->t_name != NULL) { in die_enum_create()
863 ii->ii_type = II_SOU; in die_enum_create()
864 ii->ii_name = xstrdup(tdp->t_name); in die_enum_create()
865 ii->ii_dtype = tdp; in die_enum_create()
867 iidesc_add(dw->dw_td->td_iihash, ii); in die_enum_create()
877 if (tdp->t_emem != NULL) { in die_enum_match()
879 return (-1); /* stop the iteration */ in die_enum_match()
892 if (tdp->t_flags & TDESC_F_RESOLVED) in die_enum_resolve()
895 (void) hash_find_iter(dw->dw_enumhash, tdp, die_enum_match, &full); in die_enum_resolve()
902 terminate("tdp %u: enum %s has no members\n", tdp->t_id, in die_enum_resolve()
906 debug(3, "tdp %u: enum %s redirected to %u\n", tdp->t_id, in die_enum_resolve()
907 tdesc_name(tdp), full->t_id); in die_enum_resolve()
909 tdp->t_flags |= TDESC_F_RESOLVED; in die_enum_resolve()
919 debug(3, "tdp %u: mapped forward %s to sou %u\n", fwd->t_id, in die_fwd_map()
920 tdesc_name(fwd), sou->t_id); in die_fwd_map()
921 fwd->t_tdesc = sou; in die_fwd_map()
939 Dwarf_Die mem; in die_sou_create() local
943 tdp->t_type = (die_isdecl(dw, str) ? FORWARD : type); in die_sou_create()
946 (tdp->t_type == FORWARD ? "forward decl" : typename), in die_sou_create()
949 if (tdp->t_type == FORWARD) { in die_sou_create()
950 hash_add(dw->dw_fwdhash, tdp); in die_sou_create()
954 (void) hash_find_iter(dw->dw_fwdhash, tdp, die_fwd_map, tdp); in die_sou_create()
957 tdp->t_size = sz; in die_sou_create()
962 if ((mem = die_child(dw, str)) == NULL) { in die_sou_create()
966 mlastp = &tdp->t_members; in die_sou_create()
969 Dwarf_Off memoff = die_off(dw, mem); in die_sou_create()
970 Dwarf_Half tag = die_tag(dw, mem); in die_sou_create()
975 die_create_one(dw, mem); in die_sou_create()
979 debug(3, "die %llu: mem %llu: creating member\n", off, memoff); in die_sou_create()
990 if ((ml->ml_name = die_name(dw, mem)) == NULL) in die_sou_create()
991 ml->ml_name = NULL; in die_sou_create()
993 ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); in die_sou_create()
995 if (die_mem_offset(dw, mem, DW_AT_data_member_location, in die_sou_create()
999 ml->ml_offset = mloff * 8; in die_sou_create()
1002 if (die_unsigned(dw, mem, DW_AT_bit_size, &bitsz, 0)) in die_sou_create()
1003 ml->ml_size = bitsz; in die_sou_create()
1005 ml->ml_size = tdesc_bitsize(ml->ml_type); in die_sou_create()
1007 if (die_unsigned(dw, mem, DW_AT_data_bit_offset, &bitoff, 0)) { in die_sou_create()
1008 ml->ml_offset += bitoff; in die_sou_create()
1009 } else if (die_unsigned(dw, mem, DW_AT_bit_offset, &bitoff, 0)) { in die_sou_create()
1011 ml->ml_offset += bitoff; in die_sou_create()
1017 * properly so that tdesc_bitsize(ml->ml_type) will in die_sou_create()
1018 * return 0 because ml->ml_type is unknown. As a in die_sou_create()
1024 * should equal to tdesc_bitsize(ml->ml_type)/NBBY. in die_sou_create()
1026 if (die_unsigned(dw, mem, DW_AT_byte_size, &bysz, 0) && in die_sou_create()
1028 ml->ml_offset += bysz * NBBY - bitoff - in die_sou_create()
1029 ml->ml_size; in die_sou_create()
1031 ml->ml_offset += tdesc_bitsize(ml->ml_type) - in die_sou_create()
1032 bitoff - ml->ml_size; in die_sou_create()
1036 debug(3, "die %llu: mem %llu: created \"%s\" (off %u sz %u)\n", in die_sou_create()
1037 off, memoff, ml->ml_name, ml->ml_offset, ml->ml_size); in die_sou_create()
1040 mlastp = &ml->ml_next; in die_sou_create()
1041 } while ((mem = die_sibling(dw, mem)) != NULL); in die_sou_create()
1056 * around it. If we see a no-membered struct with a nested declaration in die_sou_create()
1063 if (tdp->t_members == NULL) { in die_sou_create()
1071 if (tdp->t_name != NULL) in die_sou_create()
1072 free(tdp->t_name); in die_sou_create()
1073 tdp->t_name = new; in die_sou_create()
1078 if (tdp->t_name != NULL) { in die_sou_create()
1080 ii->ii_type = II_SOU; in die_sou_create()
1081 ii->ii_name = xstrdup(tdp->t_name); in die_sou_create()
1082 ii->ii_dtype = tdp; in die_sou_create()
1084 iidesc_add(dw->dw_td->td_iihash, ii); in die_sou_create()
1108 if (tdp->t_flags & TDESC_F_RESOLVED) in die_sou_resolve()
1113 for (ml = tdp->t_members; ml != NULL; ml = ml->ml_next) { in die_sou_resolve()
1114 if (ml->ml_size == 0) { in die_sou_resolve()
1115 mt = tdesc_basetype(ml->ml_type); in die_sou_resolve()
1117 if ((ml->ml_size = tdesc_bitsize(mt)) != 0) in die_sou_resolve()
1126 if (mt->t_members == NULL) in die_sou_resolve()
1128 if (mt->t_type == ARRAY) { in die_sou_resolve()
1129 if (mt->t_ardef->ad_nelems == 0) in die_sou_resolve()
1131 mt = tdesc_basetype(mt->t_ardef->ad_contents); in die_sou_resolve()
1132 if ((mt->t_flags & TDESC_F_RESOLVED) != 0 && in die_sou_resolve()
1133 (mt->t_type == STRUCT || in die_sou_resolve()
1134 mt->t_type == UNION) && in die_sou_resolve()
1135 mt->t_members == NULL) in die_sou_resolve()
1138 if ((mt->t_flags & TDESC_F_RESOLVED) != 0 && in die_sou_resolve()
1139 (mt->t_type == STRUCT || mt->t_type == UNION)) in die_sou_resolve()
1142 dw->dw_nunres++; in die_sou_resolve()
1146 if ((mt = tdesc_basetype(ml->ml_type)) == NULL) { in die_sou_resolve()
1147 dw->dw_nunres++; in die_sou_resolve()
1151 if (ml->ml_size != 0 && mt->t_type == INTRINSIC && in die_sou_resolve()
1152 mt->t_intr->intr_nbits != ml->ml_size) { in die_sou_resolve()
1156 * currently-referenced type isn't of the same width, in die_sou_resolve()
1161 tdp->t_id, ml->ml_size); in die_sou_resolve()
1163 ml->ml_type = tdesc_intr_clone(dw, mt, ml->ml_size, in die_sou_resolve()
1168 tdp->t_flags |= TDESC_F_RESOLVED; in die_sou_resolve()
1177 const char *typename = (tdp->t_type == STRUCT ? "struct" : "union"); in die_sou_failed()
1180 if (tdp->t_flags & TDESC_F_RESOLVED) in die_sou_failed()
1183 for (ml = tdp->t_members; ml != NULL; ml = ml->ml_next) { in die_sou_failed()
1184 if (ml->ml_size == 0) { in die_sou_failed()
1186 "of type %s (%d <%x>)\n", typename, tdp->t_id, in die_sou_failed()
1187 tdp->t_id, in die_sou_failed()
1188 ml->ml_name, tdesc_name(ml->ml_type), in die_sou_failed()
1189 ml->ml_type->t_id, ml->ml_type->t_id); in die_sou_failed()
1232 tdp->t_type = FUNCTION; in die_funcptr_create()
1235 fn->fn_ret = die_lookup_pass1(dw, die, DW_AT_type); in die_funcptr_create()
1237 fn->fn_ret = tdesc_intr_void(dw); in die_funcptr_create()
1243 for (fn->fn_nargs = 0, arg = die_child(dw, die); arg != NULL; in die_funcptr_create()
1246 fn->fn_nargs++; in die_funcptr_create()
1248 fn->fn_nargs > 0) in die_funcptr_create()
1249 fn->fn_vargs = 1; in die_funcptr_create()
1252 if (fn->fn_nargs != 0) { in die_funcptr_create()
1253 debug(3, "die %llu: adding %d argument%s\n", off, fn->fn_nargs, in die_funcptr_create()
1254 (fn->fn_nargs > 1 ? "s" : "")); in die_funcptr_create()
1256 fn->fn_args = xcalloc(sizeof (tdesc_t *) * fn->fn_nargs); in die_funcptr_create()
1258 arg != NULL && i < (int) fn->fn_nargs; in die_funcptr_create()
1263 fn->fn_args[i++] = die_lookup_pass1(dw, arg, in die_funcptr_create()
1268 tdp->t_fndef = fn; in die_funcptr_create()
1269 tdp->t_flags |= TDESC_F_RESOLVED; in die_funcptr_create()
1273 * GCC and DevPro use different names for the base types. While the terms are
1275 * are implied in one, and explicitly named in the other. Given a base type
1283 char const *base; in die_base_name_parse() local
1290 if (strlen(name) > sizeof (buf) - 1) in die_base_name_parse()
1291 terminate("base type name \"%s\" is too long\n", name); in die_base_name_parse()
1312 * the caller to fall back to the dwarf-provided in die_base_name_parse()
1326 base = "char"; in die_base_name_parse()
1332 base = "short"; in die_base_name_parse()
1335 base = "long"; in die_base_name_parse()
1338 base = "int"; in die_base_name_parse()
1342 intr->intr_type = INTR_INT; in die_base_name_parse()
1343 intr->intr_signed = sign; in die_base_name_parse()
1344 intr->intr_iformat = fmt; in die_base_name_parse()
1349 base); in die_base_name_parse()
1375 uint_t szidx = dw->dw_ptrsz == sizeof (uint64_t); in die_base_type2enc()
1388 while (map->fsm_typesz[szidx] != 0) { in die_base_type2enc()
1389 if (map->fsm_typesz[szidx] * mult == sz) in die_base_type2enc()
1390 return (map->fsm_enc[col]); in die_base_type2enc()
1400 die_base_from_dwarf(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, size_t sz) in die_base_from_dwarf() argument
1405 (void) die_unsigned(dw, base, DW_AT_encoding, &enc, DW_ATTR_REQ); in die_base_from_dwarf()
1410 intr->intr_type = INTR_INT; in die_base_from_dwarf()
1413 intr->intr_type = INTR_INT; in die_base_from_dwarf()
1414 intr->intr_iformat = 'c'; in die_base_from_dwarf()
1417 intr->intr_type = INTR_INT; in die_base_from_dwarf()
1418 intr->intr_signed = 1; in die_base_from_dwarf()
1421 intr->intr_type = INTR_INT; in die_base_from_dwarf()
1422 intr->intr_signed = 1; in die_base_from_dwarf()
1423 intr->intr_iformat = 'c'; in die_base_from_dwarf()
1426 intr->intr_type = INTR_INT; in die_base_from_dwarf()
1427 intr->intr_signed = 1; in die_base_from_dwarf()
1428 intr->intr_iformat = 'b'; in die_base_from_dwarf()
1437 intr->intr_type = INTR_REAL; in die_base_from_dwarf()
1438 intr->intr_signed = 1; in die_base_from_dwarf()
1439 intr->intr_fformat = die_base_type2enc(dw, off, enc, sz); in die_base_from_dwarf()
1442 terminate("die %llu: unknown base type encoding 0x%llx\n", in die_base_from_dwarf()
1450 die_base_create(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, tdesc_t *tdp) in die_base_create() argument
1456 debug(3, "die %llu: creating base type\n", off); in die_base_create()
1460 * as to what base types should look like. Some times gcc will, for in die_base_create()
1467 (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); in die_base_create()
1469 if (tdp->t_name == NULL) in die_base_create()
1470 terminate("die %llu: base type without name\n", off); in die_base_create()
1473 if ((intr = die_base_name_parse(tdp->t_name, &new)) != NULL) { in die_base_create()
1478 free(tdp->t_name); in die_base_create()
1479 tdp->t_name = new; in die_base_create()
1485 debug(3, "die %llu: using dwarf data for base \"%s\"\n", off, in die_base_create()
1488 intr = die_base_from_dwarf(dw, base, off, sz); in die_base_create()
1491 intr->intr_nbits = sz * 8; in die_base_create()
1493 tdp->t_type = INTRINSIC; in die_base_create()
1494 tdp->t_intr = intr; in die_base_create()
1495 tdp->t_size = sz; in die_base_create()
1497 tdp->t_flags |= TDESC_F_RESOLVED; in die_base_create()
1508 tdp->t_type = type; in die_through_create()
1511 tdp->t_tdesc = die_lookup_pass1(dw, die, DW_AT_type); in die_through_create()
1513 tdp->t_tdesc = tdesc_intr_void(dw); in die_through_create()
1517 tdp->t_size = dw->dw_ptrsz; in die_through_create()
1519 tdp->t_flags |= TDESC_F_RESOLVED; in die_through_create()
1523 ii->ii_type = II_TYPE; in die_through_create()
1524 ii->ii_name = xstrdup(tdp->t_name); in die_through_create()
1525 ii->ii_dtype = tdp; in die_through_create()
1527 iidesc_add(dw->dw_td->td_iihash, ii); in die_through_create()
1594 ii->ii_type = die_isglobal(dw, die) ? II_GFUN : II_SFUN; in die_function_create()
1595 ii->ii_name = name; in die_function_create()
1596 if (ii->ii_type == II_SFUN) in die_function_create()
1597 ii->ii_owner = xstrdup(dw->dw_cuname); in die_function_create()
1599 debug(3, "die %llu: function %s is %s\n", off, ii->ii_name, in die_function_create()
1600 (ii->ii_type == II_GFUN ? "global" : "static")); in die_function_create()
1603 ii->ii_dtype = die_lookup_pass1(dw, die, DW_AT_type); in die_function_create()
1605 ii->ii_dtype = tdesc_intr_void(dw); in die_function_create()
1619 off, ii->ii_nargs + 1); in die_function_create()
1624 ii->ii_vargs = 1; in die_function_create()
1629 ii->ii_nargs++; in die_function_create()
1632 if (ii->ii_nargs > 0) { in die_function_create()
1636 ii->ii_nargs, (ii->ii_nargs == 1 ? "" : "s")); in die_function_create()
1638 ii->ii_args = xcalloc(sizeof (tdesc_t) * ii->ii_nargs); in die_function_create()
1641 arg != NULL && i < ii->ii_nargs; in die_function_create()
1646 ii->ii_args[i++] = die_lookup_pass1(dw, arg, in die_function_create()
1651 iidesc_add(dw->dw_td->td_iihash, ii); in die_function_create()
1667 ii->ii_type = die_isglobal(dw, die) ? II_GVAR : II_SVAR; in die_variable_create()
1668 ii->ii_name = name; in die_variable_create()
1669 ii->ii_dtype = die_lookup_pass1(dw, die, DW_AT_type); in die_variable_create()
1670 if (ii->ii_type == II_SVAR) in die_variable_create()
1671 ii->ii_owner = xstrdup(dw->dw_cuname); in die_variable_create()
1673 iidesc_add(dw->dw_td->td_iihash, ii); in die_variable_create()
1680 if (fwd->t_flags & TDESC_F_RESOLVED) in die_fwd_resolve()
1683 if (fwd->t_tdesc != NULL) { in die_fwd_resolve()
1684 debug(3, "tdp %u: unforwarded %s\n", fwd->t_id, in die_fwd_resolve()
1686 *fwdp = fwd->t_tdesc; in die_fwd_resolve()
1689 fwd->t_flags |= TDESC_F_RESOLVED; in die_fwd_resolve()
1707 * there are a few which don't - primarily those which result in the creation of
1742 for (dc = die_creators; dc->dc_create != NULL; dc++) { in die_tag2ctor()
1743 if (dc->dc_tag == tag) in die_tag2ctor()
1760 if (off > dw->dw_maxoff) { in die_create_one()
1762 dw->dw_maxoff); in die_create_one()
1773 !(dc->dc_flags & DW_F_NOTDP)) { in die_create_one()
1775 tdp->t_id = off; in die_create_one()
1780 tdp->t_name = die_name(dw, die); in die_create_one()
1782 dc->dc_create(dw, die, off, tdp); in die_create_one()
1830 int last = -1; in die_resolve()
1835 dw->dw_nunres = 0; in die_resolve()
1837 (void) iitraverse_hash(dw->dw_td->td_iihash, in die_resolve()
1838 &dw->dw_td->td_curvgen, NULL, NULL, die_resolvers, dw); in die_resolve()
1840 debug(3, "resolve: pass %d, %u left\n", pass, dw->dw_nunres); in die_resolve()
1842 if ((int) dw->dw_nunres == last) { in die_resolve()
1846 (void) iitraverse_hash(dw->dw_td->td_iihash, in die_resolve()
1847 &dw->dw_td->td_curvgen, NULL, NULL, in die_resolve()
1853 last = dw->dw_nunres; in die_resolve()
1855 } while (dw->dw_nunres != 0); in die_resolve()
1937 return (-1); in dw_read()
1965 "(try compiling with -g)\n"); in dw_read()
1970 dw.dw_maxoff = nxthdr - 1; in dw_read()
2007 char *base = xstrdup(basename(dw.dw_cuname)); in dw_read() local
2009 dw.dw_cuname = base; in dw_read()