Lines Matching refs:ret

314 	int ret;  in ctf_dwarf_error()  local
323 ret = snprintf(cup->cu_errbuf, rem, "die %s: ", in ctf_dwarf_error()
325 if (ret < 0) in ctf_dwarf_error()
327 off += ret; in ctf_dwarf_error()
328 rem = MAX(rem - ret, 0); in ctf_dwarf_error()
331 ret = vsnprintf(cup->cu_errbuf + off, rem, fmt, ap); in ctf_dwarf_error()
333 if (ret < 0) in ctf_dwarf_error()
336 off += ret; in ctf_dwarf_error()
337 rem = MAX(rem - ret, 0); in ctf_dwarf_error()
417 int ret; in ctf_dwmap_add() local
424 if ((ret = ctf_dwarf_offset(cup, die, &off)) != 0) in ctf_dwmap_add()
425 return (ret); in ctf_dwmap_add()
445 int ret; in ctf_dwarf_attribute() local
449 ret = dwarf_attr(die, name, attrp, &derr); in ctf_dwarf_attribute()
451 if (ret == DW_DLV_OK) in ctf_dwarf_attribute()
453 if (ret == DW_DLV_NO_ENTRY) { in ctf_dwarf_attribute()
474 int ret; in ctf_dwarf_ref() local
478 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0) in ctf_dwarf_ref()
479 return (ret); in ctf_dwarf_ref()
482 ret = dwarf_formref(attr, refp, &derr); in ctf_dwarf_ref()
484 if (ret == DW_DLV_OK) { in ctf_dwarf_ref()
499 int ret; in ctf_dwarf_refdie() local
503 if ((ret = ctf_dwarf_ref(cup, die, name, &off)) != 0) in ctf_dwarf_refdie()
504 return (ret); in ctf_dwarf_refdie()
508 ret = dwarf_offdie(cup->cu_dwarf, off, diep, &derr); in ctf_dwarf_refdie()
510 if (ret != DW_DLV_OK) { in ctf_dwarf_refdie()
524 int ret; in ctf_dwarf_signed() local
528 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0) in ctf_dwarf_signed()
529 return (ret); in ctf_dwarf_signed()
532 ret = dwarf_formsdata(attr, valp, &derr); in ctf_dwarf_signed()
534 if (ret == DW_DLV_OK) { in ctf_dwarf_signed()
549 int ret; in ctf_dwarf_unsigned() local
553 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0) in ctf_dwarf_unsigned()
554 return (ret); in ctf_dwarf_unsigned()
557 ret = dwarf_formudata(attr, valp, &derr); in ctf_dwarf_unsigned()
559 if (ret == DW_DLV_OK) { in ctf_dwarf_unsigned()
574 int ret; in ctf_dwarf_boolean() local
578 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0) in ctf_dwarf_boolean()
579 return (ret); in ctf_dwarf_boolean()
582 ret = dwarf_formflag(attr, val, &derr); in ctf_dwarf_boolean()
584 if (ret == DW_DLV_OK) { in ctf_dwarf_boolean()
599 int ret; in ctf_dwarf_string() local
605 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0) in ctf_dwarf_string()
606 return (ret); in ctf_dwarf_string()
609 ret = dwarf_formstring(attr, &s, &derr); in ctf_dwarf_string()
611 if (ret == DW_DLV_OK) { in ctf_dwarf_string()
613 ret = ENOMEM; in ctf_dwarf_string()
615 ret = 0; in ctf_dwarf_string()
617 return (ret); in ctf_dwarf_string()
636 int ret; in ctf_dwarf_member_location() local
644 if ((ret = ctf_dwarf_attribute(cup, die, DW_AT_data_member_location, in ctf_dwarf_member_location()
646 return (ret); in ctf_dwarf_member_location()
650 ret = dwarf_whatform(attr, &form, &derr); in ctf_dwarf_member_location()
652 if (ret != DW_DLV_OK) { in ctf_dwarf_member_location()
723 int ret; in ctf_dwarf_offset() local
726 ret = dwarf_dieoffset(die, offsetp, &derr); in ctf_dwarf_offset()
728 if (ret == DW_DLV_OK) in ctf_dwarf_offset()
754 int ret; in ctf_dwarf_tag() local
757 ret = dwarf_tag(die, tagp, &derr); in ctf_dwarf_tag()
759 if (ret == DW_DLV_OK) in ctf_dwarf_tag()
772 int ret; in ctf_dwarf_sib() local
776 ret = dwarf_siblingof(cup->cu_dwarf, base, sibp, &derr); in ctf_dwarf_sib()
778 if (ret == DW_DLV_OK || ret == DW_DLV_NO_ENTRY) in ctf_dwarf_sib()
791 int ret; in ctf_dwarf_child() local
795 ret = dwarf_child(base, childp, &derr); in ctf_dwarf_child()
797 if (ret == DW_DLV_OK || ret == DW_DLV_NO_ENTRY) in ctf_dwarf_child()
815 int ret; in ctf_dwarf_isglobal() local
819 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_visibility, &vis)) == 0) { in ctf_dwarf_isglobal()
822 } else if (ret != ENOENT) { in ctf_dwarf_isglobal()
823 return (ret); in ctf_dwarf_isglobal()
826 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_external, &ext)) != 0) { in ctf_dwarf_isglobal()
827 if (ret == ENOENT) { in ctf_dwarf_isglobal()
831 return (ret); in ctf_dwarf_isglobal()
1009 int ret; in ctf_dwarf_dwarf_base() local
1012 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_encoding, &type)) != 0) in ctf_dwarf_dwarf_base()
1013 return (ret); in ctf_dwarf_dwarf_base()
1043 if ((ret = ctf_dwarf_float_base(cup, type, enc)) != 0) in ctf_dwarf_dwarf_base()
1044 return (ret); in ctf_dwarf_dwarf_base()
1138 int ret; in ctf_dwarf_create_base() local
1145 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0) in ctf_dwarf_create_base()
1146 return (ret); in ctf_dwarf_create_base()
1147 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, &sz)) != 0) { in ctf_dwarf_create_base()
1155 if ((ret = ctf_dwarf_parse_int(name, &kind, &enc, &nname)) == 0) { in ctf_dwarf_create_base()
1159 if (ret != EINVAL) { in ctf_dwarf_create_base()
1163 if ((ret = ctf_dwarf_dwarf_base(cup, die, &kind, &enc)) != 0) { in ctf_dwarf_create_base()
1167 if (kind == CTF_K_FLOAT && (ret = ctf_dwarf_fixup_complex(cup, in ctf_dwarf_create_base()
1178 ret = ctf_errno(cup->cu_ctfp); in ctf_dwarf_create_base()
1181 ret = ctf_dwmap_add(cup, id, die, B_FALSE); in ctf_dwarf_create_base()
1185 return (ret); in ctf_dwarf_create_base()
1210 int ret; in ctf_dwarf_member_offset() local
1216 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_data_bit_offset, in ctf_dwarf_member_offset()
1220 } else if (ret != ENOENT) { in ctf_dwarf_member_offset()
1221 return (ret); in ctf_dwarf_member_offset()
1224 if ((ret = ctf_dwarf_member_location(cup, die, &loc)) != 0) in ctf_dwarf_member_offset()
1225 return (ret); in ctf_dwarf_member_offset()
1228 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_bit_offset, in ctf_dwarf_member_offset()
1230 if (ret != ENOENT) in ctf_dwarf_member_offset()
1231 return (ret); in ctf_dwarf_member_offset()
1237 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_bit_size, &bitsz)) != 0) in ctf_dwarf_member_offset()
1238 return (ret); in ctf_dwarf_member_offset()
1240 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, in ctf_dwarf_member_offset()
1242 if (ret != ENOENT) in ctf_dwarf_member_offset()
1243 return (ret); in ctf_dwarf_member_offset()
1279 int ret; in ctf_dwarf_member_bitfield() local
1287 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_bit_size, &bitsz)) != 0) { in ctf_dwarf_member_bitfield()
1288 if (ret == ENOENT) in ctf_dwarf_member_bitfield()
1290 return (ret); in ctf_dwarf_member_bitfield()
1385 int ret, kind; in ctf_dwarf_fixup_sou() local
1396 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) in ctf_dwarf_fixup_sou()
1397 return (ret); in ctf_dwarf_fixup_sou()
1409 if ((ret = ctf_dwarf_tag(cup, memb, &tag)) != 0) in ctf_dwarf_fixup_sou()
1410 return (ret); in ctf_dwarf_fixup_sou()
1415 if ((ret = ctf_dwarf_refdie(cup, memb, DW_AT_type, &tdie)) != 0) in ctf_dwarf_fixup_sou()
1416 return (ret); in ctf_dwarf_fixup_sou()
1418 if ((ret = ctf_dwarf_convert_type(cup, tdie, &mid, in ctf_dwarf_fixup_sou()
1420 return (ret); in ctf_dwarf_fixup_sou()
1427 if ((ret = ctf_dwarf_member_bitfield(cup, memb, in ctf_dwarf_fixup_sou()
1429 return (ret); in ctf_dwarf_fixup_sou()
1433 if ((ret = ctf_dwarf_string(cup, memb, DW_AT_name, in ctf_dwarf_fixup_sou()
1434 &mname)) != 0 && ret != ENOENT) in ctf_dwarf_fixup_sou()
1435 return (ret); in ctf_dwarf_fixup_sou()
1436 if (ret == ENOENT) in ctf_dwarf_fixup_sou()
1441 } else if ((ret = ctf_dwarf_member_offset(cup, memb, mid, in ctf_dwarf_fixup_sou()
1445 return (ret); in ctf_dwarf_fixup_sou()
1448 if ((ret = ctf_dwarf_member_bitfield(cup, memb, &mid)) != 0) in ctf_dwarf_fixup_sou()
1449 return (ret); in ctf_dwarf_fixup_sou()
1451 ret = ctf_add_member(cup->cu_ctfp, base, mname, mid, memboff); in ctf_dwarf_fixup_sou()
1452 if (ret == CTF_ERR) { in ctf_dwarf_fixup_sou()
1465 if ((ret = ctf_dwarf_sib(cup, memb, &sib)) != 0) in ctf_dwarf_fixup_sou()
1466 return (ret); in ctf_dwarf_fixup_sou()
1478 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, &size)) != 0) in ctf_dwarf_fixup_sou()
1479 return (ret); in ctf_dwarf_fixup_sou()
1495 int ret; in ctf_dwarf_create_sou() local
1505 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 && in ctf_dwarf_create_sou()
1506 ret != ENOENT) in ctf_dwarf_create_sou()
1507 return (ret); in ctf_dwarf_create_sou()
1508 if (ret == ENOENT) in ctf_dwarf_create_sou()
1517 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, in ctf_dwarf_create_sou()
1519 if (ret != ENOENT) in ctf_dwarf_create_sou()
1520 return (ret); in ctf_dwarf_create_sou()
1545 if ((ret = ctf_dwmap_add(cup, base, die, B_TRUE)) != 0) in ctf_dwarf_create_sou()
1546 return (ret); in ctf_dwarf_create_sou()
1555 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) in ctf_dwarf_create_sou()
1556 return (ret); in ctf_dwarf_create_sou()
1562 if ((ret = ctf_dwarf_tag(cup, child, &tag)) != 0) in ctf_dwarf_create_sou()
1563 return (ret); in ctf_dwarf_create_sou()
1568 ret = ctf_dwarf_convert_type(cup, child, NULL, in ctf_dwarf_create_sou()
1570 if (ret != 0) { in ctf_dwarf_create_sou()
1571 return (ret); in ctf_dwarf_create_sou()
1578 if ((ret = ctf_dwarf_sib(cup, child, &sib)) != 0) in ctf_dwarf_create_sou()
1579 return (ret); in ctf_dwarf_create_sou()
1597 int ret = 0; in ctf_dwarf_array_upper_bound() local
1616 ret = ctf_dwarf_attribute(cup, range, DW_AT_count, &attr); in ctf_dwarf_array_upper_bound()
1617 if (ret != 0 && ret != ENOENT) { in ctf_dwarf_array_upper_bound()
1618 return (ret); in ctf_dwarf_array_upper_bound()
1619 } else if (ret == ENOENT) { in ctf_dwarf_array_upper_bound()
1621 ret = ctf_dwarf_attribute(cup, range, DW_AT_upper_bound, &attr); in ctf_dwarf_array_upper_bound()
1622 if (ret != 0 && ret != ENOENT) { in ctf_dwarf_array_upper_bound()
1623 return (ret); in ctf_dwarf_array_upper_bound()
1624 } else if (ret == ENOENT) { in ctf_dwarf_array_upper_bound()
1632 ret = dwarf_whatform(attr, &form, &derr); in ctf_dwarf_array_upper_bound()
1633 if (ret != DW_DLV_OK) { in ctf_dwarf_array_upper_bound()
1637 ret = ECTF_CONVBKERR; in ctf_dwarf_array_upper_bound()
1703 ret = ECTF_CONVBKERR; in ctf_dwarf_array_upper_bound()
1708 return (ret); in ctf_dwarf_array_upper_bound()
1715 int ret; in ctf_dwarf_create_array_range() local
1721 if ((ret = ctf_dwarf_sib(cup, range, &sib)) != 0) in ctf_dwarf_create_array_range()
1722 return (ret); in ctf_dwarf_create_array_range()
1725 if ((ret = ctf_dwarf_create_array_range(cup, sib, &id, in ctf_dwarf_create_array_range()
1727 return (ret); in ctf_dwarf_create_array_range()
1736 if ((ret = ctf_dwarf_array_upper_bound(cup, range, &ar)) != 0) in ctf_dwarf_create_array_range()
1737 return (ret); in ctf_dwarf_create_array_range()
1753 int ret; in ctf_dwarf_create_array() local
1758 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) in ctf_dwarf_create_array()
1759 return (ret); in ctf_dwarf_create_array()
1760 if ((ret = ctf_dwarf_convert_type(cup, tdie, &tid, in ctf_dwarf_create_array()
1762 return (ret); in ctf_dwarf_create_array()
1764 if ((ret = ctf_dwarf_child(cup, die, &rdie)) != 0) in ctf_dwarf_create_array()
1765 return (ret); in ctf_dwarf_create_array()
1766 if ((ret = ctf_dwarf_tag(cup, rdie, &rtag)) != 0) in ctf_dwarf_create_array()
1767 return (ret); in ctf_dwarf_create_array()
1780 if ((ret = ctf_dwarf_create_array_range(cup, rdie, idp, tid, in ctf_dwarf_create_array()
1782 return (ret); in ctf_dwarf_create_array()
1860 int ret; in ctf_dwarf_create_reference() local
1865 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 && in ctf_dwarf_create_reference()
1866 ret != ENOENT) in ctf_dwarf_create_reference()
1867 return (ret); in ctf_dwarf_create_reference()
1868 if (ret == ENOENT) in ctf_dwarf_create_reference()
1873 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) { in ctf_dwarf_create_reference()
1874 if (ret != ENOENT) { in ctf_dwarf_create_reference()
1876 return (ret); in ctf_dwarf_create_reference()
1883 if ((ret = ctf_dwarf_convert_type(cup, tdie, &id, in ctf_dwarf_create_reference()
1886 return (ret); in ctf_dwarf_create_reference()
1890 if ((ret = needed_array_qualifier(cup, kind, id)) <= 0) { in ctf_dwarf_create_reference()
1891 if (ret != 0) { in ctf_dwarf_create_reference()
1892 ret = (ctf_errno(cup->cu_ctfp)); in ctf_dwarf_create_reference()
1898 return (ret); in ctf_dwarf_create_reference()
1919 int ret; in ctf_dwarf_create_enum() local
1921 ret = ctf_dwarf_string(cup, die, DW_AT_name, &enumname); in ctf_dwarf_create_enum()
1922 if (ret != 0 && ret != ENOENT) in ctf_dwarf_create_enum()
1923 return (ret); in ctf_dwarf_create_enum()
1924 if (ret == ENOENT) in ctf_dwarf_create_enum()
1941 ret = ctf_errno(cup->cu_ctfp); in ctf_dwarf_create_enum()
1945 if ((ret = ctf_dwmap_add(cup, id, die, B_FALSE)) != 0) in ctf_dwarf_create_enum()
1948 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) { in ctf_dwarf_create_enum()
1949 if (ret == ENOENT) in ctf_dwarf_create_enum()
1950 ret = 0; in ctf_dwarf_create_enum()
1962 if ((ret = ctf_dwarf_sib(cup, arg, &child)) != 0) in ctf_dwarf_create_enum()
1965 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0) in ctf_dwarf_create_enum()
1969 if ((ret = ctf_dwarf_convert_type(cup, arg, NULL, in ctf_dwarf_create_enum()
1979 if ((ret = ctf_dwarf_string(cup, arg, DW_AT_name, &name)) != 0) in ctf_dwarf_create_enum()
1988 if ((ret = ctf_dwarf_unsigned(cup, arg, DW_AT_const_value, in ctf_dwarf_create_enum()
1998 if ((ret = ctf_dwarf_signed(cup, arg, DW_AT_const_value, in ctf_dwarf_create_enum()
2004 if (ret != 0) { in ctf_dwarf_create_enum()
2005 if (ret == ENOENT) { in ctf_dwarf_create_enum()
2009 ret = ECTF_CONVBKERR; in ctf_dwarf_create_enum()
2015 ret = ctf_add_enumerator(cup->cu_ctfp, id, name, eval); in ctf_dwarf_create_enum()
2016 if (ret == CTF_ERR) { in ctf_dwarf_create_enum()
2017 ret = ctf_errno(cup->cu_ctfp); in ctf_dwarf_create_enum()
2019 if (ret == ECTF_DTFULL && (cup->cu_handle->cch_flags & in ctf_dwarf_create_enum()
2028 ret = 0; in ctf_dwarf_create_enum()
2046 return (ret); in ctf_dwarf_create_enum()
2056 int ret; in ctf_dwarf_create_fptr() local
2064 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) != 0) { in ctf_dwarf_create_fptr()
2065 if (ret != ENOENT) in ctf_dwarf_create_fptr()
2066 return (ret); in ctf_dwarf_create_fptr()
2075 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &retdie)) != 0) { in ctf_dwarf_create_fptr()
2076 if (ret != ENOENT) in ctf_dwarf_create_fptr()
2077 return (ret); in ctf_dwarf_create_fptr()
2081 if ((ret = ctf_dwarf_convert_type(cup, retdie, &fi.ctc_return, in ctf_dwarf_create_fptr()
2083 return (ret); in ctf_dwarf_create_fptr()
2086 if ((ret = ctf_dwarf_function_count(cup, die, &fi, B_TRUE)) != 0) { in ctf_dwarf_create_fptr()
2087 return (ret); in ctf_dwarf_create_fptr()
2095 if ((ret = ctf_dwarf_convert_fargs(cup, die, &fi, argv)) != 0) { in ctf_dwarf_create_fptr()
2097 return (ret); in ctf_dwarf_create_fptr()
2115 int ret; in ctf_dwarf_convert_type() local
2124 if ((ret = ctf_dwarf_offset(cup, die, &offset)) != 0) in ctf_dwarf_convert_type()
2125 return (ret); in ctf_dwarf_convert_type()
2143 if ((ret = ctf_dwarf_tag(cup, die, &tag)) != 0) in ctf_dwarf_convert_type()
2144 return (ret); in ctf_dwarf_convert_type()
2146 ret = ENOTSUP; in ctf_dwarf_convert_type()
2150 ret = ctf_dwarf_create_base(cup, die, idp, isroot, offset); in ctf_dwarf_convert_type()
2154 ret = ctf_dwarf_create_array(cup, die, idp, isroot); in ctf_dwarf_convert_type()
2158 ret = ctf_dwarf_create_enum(cup, die, idp, isroot); in ctf_dwarf_convert_type()
2162 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_POINTER, in ctf_dwarf_convert_type()
2167 ret = ctf_dwarf_create_sou(cup, die, idp, CTF_K_STRUCT, in ctf_dwarf_convert_type()
2172 ret = ctf_dwarf_create_fptr(cup, die, idp, isroot); in ctf_dwarf_convert_type()
2176 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_TYPEDEF, in ctf_dwarf_convert_type()
2181 ret = ctf_dwarf_create_sou(cup, die, idp, CTF_K_UNION, in ctf_dwarf_convert_type()
2186 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_CONST, in ctf_dwarf_convert_type()
2191 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_VOLATILE, in ctf_dwarf_convert_type()
2196 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_RESTRICT, in ctf_dwarf_convert_type()
2202 ret = 0; in ctf_dwarf_convert_type()
2206 ret); in ctf_dwarf_convert_type()
2208 return (ret); in ctf_dwarf_convert_type()
2214 int ret; in ctf_dwarf_walk_lexical() local
2217 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) in ctf_dwarf_walk_lexical()
2218 return (ret); in ctf_dwarf_walk_lexical()
2230 int ret; in ctf_dwarf_function_count() local
2233 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) in ctf_dwarf_function_count()
2234 return (ret); in ctf_dwarf_function_count()
2240 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0) in ctf_dwarf_function_count()
2241 return (ret); in ctf_dwarf_function_count()
2258 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, in ctf_dwarf_function_count()
2260 return (ret); in ctf_dwarf_function_count()
2272 if ((ret = ctf_dwarf_sib(cup, arg, &sib)) != 0) in ctf_dwarf_function_count()
2273 return (ret); in ctf_dwarf_function_count()
2284 int ret; in ctf_dwarf_convert_fargs() local
2288 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) in ctf_dwarf_convert_fargs()
2289 return (ret); in ctf_dwarf_convert_fargs()
2295 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0) in ctf_dwarf_convert_fargs()
2296 return (ret); in ctf_dwarf_convert_fargs()
2300 if ((ret = ctf_dwarf_refdie(cup, arg, DW_AT_type, in ctf_dwarf_convert_fargs()
2302 return (ret); in ctf_dwarf_convert_fargs()
2304 if ((ret = ctf_dwarf_convert_type(cup, tdie, &argv[i], in ctf_dwarf_convert_fargs()
2306 return (ret); in ctf_dwarf_convert_fargs()
2318 if ((ret = ctf_dwarf_sib(cup, arg, &sib)) != 0) in ctf_dwarf_convert_fargs()
2319 return (ret); in ctf_dwarf_convert_fargs()
2333 int ret; in ctf_dwarf_convert_function() local
2341 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0) { in ctf_dwarf_convert_function()
2342 if (ret == ENOENT) in ctf_dwarf_convert_function()
2344 return (ret); in ctf_dwarf_convert_function()
2350 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) != 0) { in ctf_dwarf_convert_function()
2351 if (ret != ENOENT) { in ctf_dwarf_convert_function()
2353 return (ret); in ctf_dwarf_convert_function()
2376 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) == 0) { in ctf_dwarf_convert_function()
2377 if ((ret = ctf_dwarf_convert_type(cup, tdie, in ctf_dwarf_convert_function()
2381 return (ret); in ctf_dwarf_convert_function()
2383 } else if (ret != ENOENT) { in ctf_dwarf_convert_function()
2386 return (ret); in ctf_dwarf_convert_function()
2406 if ((ret = ctf_dwarf_function_count(cup, die, &cdf->cdf_fip, in ctf_dwarf_convert_function()
2410 return (ret); in ctf_dwarf_convert_function()
2422 if ((ret = ctf_dwarf_convert_fargs(cup, die, in ctf_dwarf_convert_function()
2427 return (ret); in ctf_dwarf_convert_function()
2433 if ((ret = ctf_dwarf_isglobal(cup, die, &cdf->cdf_global)) != 0) { in ctf_dwarf_convert_function()
2438 return (ret); in ctf_dwarf_convert_function()
2442 return (ret); in ctf_dwarf_convert_function()
2451 int ret; in ctf_dwarf_convert_variable() local
2459 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) == 0) { in ctf_dwarf_convert_variable()
2462 } else if (ret != ENOENT) { in ctf_dwarf_convert_variable()
2463 return (ret); in ctf_dwarf_convert_variable()
2473 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_specification, in ctf_dwarf_convert_variable()
2476 if ((ret = ctf_dwarf_offset(cup, tdie, &offset)) != 0) in ctf_dwarf_convert_variable()
2477 return (ret); in ctf_dwarf_convert_variable()
2481 } else if (ret != ENOENT) { in ctf_dwarf_convert_variable()
2482 return (ret); in ctf_dwarf_convert_variable()
2485 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 && in ctf_dwarf_convert_variable()
2486 ret != ENOENT) in ctf_dwarf_convert_variable()
2487 return (ret); in ctf_dwarf_convert_variable()
2488 if (ret == ENOENT) in ctf_dwarf_convert_variable()
2491 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) { in ctf_dwarf_convert_variable()
2493 return (ret); in ctf_dwarf_convert_variable()
2496 if ((ret = ctf_dwarf_convert_type(cup, tdie, &id, in ctf_dwarf_convert_variable()
2498 return (ret); in ctf_dwarf_convert_variable()
2508 if ((ret = ctf_dwarf_isglobal(cup, die, &cdv->cdv_global)) != 0) { in ctf_dwarf_convert_variable()
2511 return (ret); in ctf_dwarf_convert_variable()
2524 int ret; in ctf_dwarf_walk_toplevel() local
2528 if ((ret = ctf_dwarf_offset(cup, die, &offset)) != 0) in ctf_dwarf_walk_toplevel()
2529 return (ret); in ctf_dwarf_walk_toplevel()
2538 if ((ret = ctf_dwarf_tag(cup, die, &tag)) != 0) in ctf_dwarf_walk_toplevel()
2539 return (ret); in ctf_dwarf_walk_toplevel()
2541 ret = 0; in ctf_dwarf_walk_toplevel()
2545 ret = ctf_dwarf_convert_function(cup, die); in ctf_dwarf_walk_toplevel()
2549 ret = ctf_dwarf_convert_variable(cup, die); in ctf_dwarf_walk_toplevel()
2553 ret = ctf_dwarf_walk_lexical(cup, die); in ctf_dwarf_walk_toplevel()
2560 ret = ctf_dwarf_convert_type(cup, die, NULL, B_TRUE); in ctf_dwarf_walk_toplevel()
2566 return (ret); in ctf_dwarf_walk_toplevel()
2578 int ret; in ctf_dwarf_convert_die() local
2581 if ((ret = ctf_dwarf_walk_toplevel(cup, die)) != 0) in ctf_dwarf_convert_die()
2582 return (ret); in ctf_dwarf_convert_die()
2584 if ((ret = ctf_dwarf_sib(cup, die, &sib)) != 0) in ctf_dwarf_convert_die()
2585 return (ret); in ctf_dwarf_convert_die()
2598 int ret; in ctf_dwarf_fixup_die() local
2601 if ((ret = ctf_dwarf_fixup_sou(cup, map->cdm_die, map->cdm_id, in ctf_dwarf_fixup_die()
2603 return (ret); in ctf_dwarf_fixup_die()
2732 int ret; in ctf_dwarf_conv_funcvars_cb() local
2750 ret = ctf_add_object(cup->cu_ctfp, idx, cdv->cdv_type); in ctf_dwarf_conv_funcvars_cb()
2757 ret = ctf_add_function(cup->cu_ctfp, idx, &cdf->cdf_fip, in ctf_dwarf_conv_funcvars_cb()
2762 if (ret == CTF_ERR) { in ctf_dwarf_conv_funcvars_cb()
2893 int ret; in ctf_dwarf_duplicate_func() local
2916 ret = ctf_add_function(cup->cu_ctfp, idx, &fip, args); in ctf_dwarf_duplicate_func()
2919 if (ret == CTF_ERR) in ctf_dwarf_duplicate_func()
2929 int ret, type; in ctf_dwarf_conv_weaks_cb() local
2954 ret = ctf_symtab_iter(cup->cu_ctfp, ctf_dwarf_conv_check_weak, &cweak); in ctf_dwarf_conv_weaks_cb()
2955 VERIFY(ret == 0 || ret == 1); in ctf_dwarf_conv_weaks_cb()
2961 if (ret == 0 && cweak.cweak_candidate == B_FALSE) { in ctf_dwarf_conv_weaks_cb()
2971 ret = ctf_dwarf_duplicate_sym(cup, idx, cweak.cweak_idx); in ctf_dwarf_conv_weaks_cb()
2973 ret = ctf_dwarf_duplicate_func(cup, idx, cweak.cweak_idx); in ctf_dwarf_conv_weaks_cb()
2976 return (ret); in ctf_dwarf_conv_weaks_cb()
2988 int ret; in ctf_dwarf_convert_one() local
2995 if ((ret = ctf_dwarf_init_die(cup)) != 0) in ctf_dwarf_convert_one()
2996 return (ret); in ctf_dwarf_convert_one()
3001 ret = ctf_dwarf_convert_die(cup, cup->cu_cu); in ctf_dwarf_convert_one()
3003 ret); in ctf_dwarf_convert_one()
3004 if (ret != 0) in ctf_dwarf_convert_one()
3005 return (ret); in ctf_dwarf_convert_one()
3012 ret = ctf_dwarf_fixup_die(cup, B_FALSE); in ctf_dwarf_convert_one()
3014 ret); in ctf_dwarf_convert_one()
3015 if (ret != 0) in ctf_dwarf_convert_one()
3016 return (ret); in ctf_dwarf_convert_one()
3023 ret = ctf_dwarf_fixup_die(cup, B_TRUE); in ctf_dwarf_convert_one()
3025 ret); in ctf_dwarf_convert_one()
3026 if (ret != 0) in ctf_dwarf_convert_one()
3027 return (ret); in ctf_dwarf_convert_one()
3034 if ((ret = ctf_dwarf_conv_funcvars(cup)) != 0) { in ctf_dwarf_convert_one()
3036 name, ret); in ctf_dwarf_convert_one()
3037 return (ctf_dwarf_error(cup, NULL, ret, in ctf_dwarf_convert_one()
3047 if ((ret = ctf_dwarf_conv_weaks(cup)) != 0) { in ctf_dwarf_convert_one()
3049 name, ret); in ctf_dwarf_convert_one()
3050 return (ctf_dwarf_error(cup, NULL, ret, in ctf_dwarf_convert_one()
3062 if ((ret = ctf_merge_add(cup->cu_cmh, cup->cu_ctfp)) != 0) { in ctf_dwarf_convert_one()
3063 return (ctf_dwarf_error(cup, NULL, ret, in ctf_dwarf_convert_one()
3068 if ((ret = ctf_merge_dedup(cup->cu_cmh, &dedup)) != 0) { in ctf_dwarf_convert_one()
3069 return (ctf_dwarf_error(cup, NULL, ret, in ctf_dwarf_convert_one()
3151 int ret; in ctf_dwarf_count_dies() local
3155 while ((ret = dwarf_next_cu_header(dw, NULL, &vers, NULL, NULL, in ctf_dwarf_count_dies()
3157 if (ret != DW_DLV_OK) { in ctf_dwarf_count_dies()
3192 int ret, i = 0; in ctf_dwarf_preinit_dies() local
3194 while ((ret = dwarf_next_cu_header(dw, &hdrlen, &vers, &abboff, in ctf_dwarf_preinit_dies()
3229 if ((ret = ctf_dwarf_sib(cup, NULL, &cu)) != 0) { in ctf_dwarf_preinit_dies()
3230 ctf_dprintf("cu %d - no cu %d\n", i, ret); in ctf_dwarf_preinit_dies()
3231 return (ret); in ctf_dwarf_preinit_dies()
3250 ret = ctf_dwarf_child(cup, cu, &cup->cu_cu); in ctf_dwarf_preinit_dies()
3252 if (ret != 0) { in ctf_dwarf_preinit_dies()
3255 ret); in ctf_dwarf_preinit_dies()
3256 return (ret); in ctf_dwarf_preinit_dies()
3264 ret); in ctf_dwarf_preinit_dies()
3309 int ret; in ctf_dwarf_init_die() local
3311 cup->cu_ctfp = ctf_fdcreate(cup->cu_fd, &ret); in ctf_dwarf_init_die()
3313 return (ret); in ctf_dwarf_init_die()
3318 if ((ret = ctf_dwarf_die_elfenc(cup->cu_elf, cup, in ctf_dwarf_init_die()
3320 return (ret); in ctf_dwarf_init_die()
3323 if ((cup->cu_cmh = ctf_merge_init(cup->cu_fd, &ret)) == NULL) in ctf_dwarf_init_die()
3324 return (ret); in ctf_dwarf_init_die()
3388 int ret = 0; in ctf_dwarf_check_missing() local
3453 if (ret != ECTF_CONVNODEBUG) { in ctf_dwarf_check_missing()
3457 ret = ECTF_CONVNODEBUG; in ctf_dwarf_check_missing()
3462 return (ret); in ctf_dwarf_check_missing()
3472 int ret, err; in ctf_dwarf_convert_batch() local
3504 ret = workq_work(wqp, ctf_dwarf_convert_one, NULL, &err); in ctf_dwarf_convert_batch()
3505 if (ret == WORKQ_ERROR) { in ctf_dwarf_convert_batch()
3508 } else if (ret == WORKQ_UERROR) { in ctf_dwarf_convert_batch()
3578 int err, ret; in ctf_dwarf_convert() local
3588 ret = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw, &derr); in ctf_dwarf_convert()
3589 if (ret != DW_DLV_OK) { in ctf_dwarf_convert()
3590 if (ret == DW_DLV_NO_ENTRY || in ctf_dwarf_convert()