Lines Matching refs:ret
298 int ret;
307 ret = snprintf(cup->cu_errbuf, rem, "die %s: ", cup->cu_name);
308 if (ret < 0)
310 off += ret;
311 rem = MAX(rem - ret, 0);
314 ret = vsnprintf(cup->cu_errbuf + off, rem, fmt, ap);
316 if (ret < 0)
319 off += ret;
320 rem = MAX(rem - ret, 0);
400 int ret;
407 if ((ret = ctf_dwarf_offset(cup, die, &off)) != 0)
408 return (ret);
428 int ret;
431 if ((ret = dwarf_attr(die, name, attrp, &derr)) == DW_DLV_OK)
433 if (ret == DW_DLV_NO_ENTRY) {
446 int ret;
450 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0)
451 return (ret);
468 int ret;
472 if ((ret = ctf_dwarf_ref(cup, die, name, &off)) != 0)
473 return (ret);
476 if ((ret = dwarf_offdie(cup->cu_dwarf, off, diep, &derr)) !=
491 int ret;
495 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0)
496 return (ret);
513 int ret;
517 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0)
518 return (ret);
535 int ret;
539 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0)
540 return (ret);
557 int ret;
563 if ((ret = ctf_dwarf_attribute(cup, die, name, &attr)) != 0)
564 return (ret);
568 ret = ENOMEM;
570 ret = 0;
572 return (ret);
584 int ret;
590 if ((ret = ctf_dwarf_attribute(cup, die, DW_AT_data_member_location,
592 return (ret);
662 int ret;
665 ret = dwarf_siblingof(cup->cu_dwarf, base, sibp, &derr);
666 if (ret == DW_DLV_OK || ret == DW_DLV_NO_ENTRY)
679 int ret;
682 ret = dwarf_child(base, childp, &derr);
683 if (ret == DW_DLV_OK || ret == DW_DLV_NO_ENTRY)
701 int ret;
705 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_visibility, &vis)) == 0) {
708 } else if (ret != ENOENT) {
709 return (ret);
712 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_external, &ext)) != 0) {
713 if (ret == ENOENT) {
717 return (ret);
850 int ret;
853 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_encoding, &type)) != 0)
854 return (ret);
884 if ((ret = ctf_dwarf_float_base(cup, type, enc)) != 0)
885 return (ret);
979 int ret;
986 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0)
987 return (ret);
988 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, &sz)) != 0) {
996 if ((ret = ctf_dwarf_parse_base(name, &kind, &enc, &nname)) == 0) {
1000 if (ret != EINVAL)
1001 return (ret);
1003 if ((ret = ctf_dwarf_dwarf_base(cup, die, &kind, &enc)) != 0)
1004 return (ret);
1009 ret = ctf_errno(cup->cu_ctfp);
1012 ret = ctf_dwmap_add(cup, id, die, B_FALSE);
1016 return (ret);
1041 int ret;
1047 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_data_bit_offset,
1051 } else if (ret != ENOENT) {
1052 return (ret);
1055 if ((ret = ctf_dwarf_member_location(cup, die, &loc)) != 0)
1056 return (ret);
1059 if ((ret = ctf_dwarf_signed(cup, die, DW_AT_bit_offset,
1061 if (ret != ENOENT)
1062 return (ret);
1068 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_bit_size, &bitsz)) != 0)
1069 return (ret);
1071 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size,
1073 if (ret != ENOENT)
1074 return (ret);
1110 int ret;
1118 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_bit_size, &bitsz)) != 0) {
1119 if (ret == ENOENT)
1121 return (ret);
1216 int ret, kind;
1228 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0)
1229 return (ret);
1241 if ((ret = ctf_dwarf_tag(cup, memb, &tag)) != 0)
1242 return (ret);
1247 if ((ret = ctf_dwarf_refdie(cup, memb, DW_AT_type, &tdie)) != 0)
1248 return (ret);
1250 if ((ret = ctf_dwarf_convert_type(cup, tdie, &mid,
1252 return (ret);
1259 if ((ret = ctf_dwarf_member_bitfield(cup, memb,
1261 return (ret);
1265 if ((ret = ctf_dwarf_string(cup, memb, DW_AT_name,
1266 &mname)) != 0 && ret != ENOENT)
1267 return (ret);
1268 if (ret == ENOENT)
1273 } else if ((ret = ctf_dwarf_member_offset(cup, memb, mid,
1277 return (ret);
1280 if ((ret = ctf_dwarf_member_bitfield(cup, memb, &mid)) != 0)
1281 return (ret);
1283 ret = ctf_add_member(cup->cu_ctfp, base, mname, mid, memboff);
1284 if (ret == CTF_ERR) {
1297 if ((ret = ctf_dwarf_sib(cup, memb, &sib)) != 0)
1298 return (ret);
1310 if ((ret = ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, &size)) != 0)
1311 return (ret);
1328 int ret;
1338 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 &&
1339 ret != ENOENT)
1340 return (ret);
1341 if (ret == ENOENT)
1350 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration,
1352 if (ret != ENOENT)
1353 return (ret);
1377 if ((ret = ctf_dwmap_add(cup, base, die, B_TRUE)) != 0)
1378 return (ret);
1383 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0)
1384 return (ret);
1395 int ret;
1403 if ((ret = ctf_dwarf_sib(cup, range, &sib)) != 0)
1404 return (ret);
1407 if ((ret = ctf_dwarf_create_array_range(cup, sib, &id,
1409 return (ret);
1429 if ((ret = ctf_dwarf_unsigned(cup, range, DW_AT_upper_bound,
1432 } else if (ret != ENOENT) {
1433 return (ret);
1434 } else if ((ret = ctf_dwarf_signed(cup, range, DW_AT_upper_bound,
1437 } else if (ret != ENOENT) {
1438 return (ret);
1457 int ret;
1462 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0)
1463 return (ret);
1464 if ((ret = ctf_dwarf_convert_type(cup, tdie, &tid,
1466 return (ret);
1468 if ((ret = ctf_dwarf_child(cup, die, &rdie)) != 0)
1469 return (ret);
1470 if ((ret = ctf_dwarf_tag(cup, rdie, &rtag)) != 0)
1471 return (ret);
1484 if ((ret = ctf_dwarf_create_array_range(cup, rdie, idp, tid,
1486 return (ret);
1495 int ret;
1501 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 &&
1502 ret != ENOENT)
1503 return (ret);
1504 if (ret == ENOENT) {
1513 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) {
1514 if (ret != ENOENT) {
1516 return (ret);
1523 if ((ret = ctf_dwarf_convert_type(cup, tdie, &id,
1526 return (ret);
1543 int ret;
1548 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 &&
1549 ret != ENOENT)
1550 return (ret);
1551 if (ret == ENOENT)
1560 if ((ret = ctf_dwmap_add(cup, id, die, B_FALSE)) != 0)
1561 return (ret);
1563 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0) {
1564 if (ret == ENOENT)
1565 ret = 0;
1566 return (ret);
1576 if ((ret = ctf_dwarf_sib(cup, arg, &child)) != 0)
1577 return (ret);
1579 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0)
1580 return (ret);
1583 if ((ret = ctf_dwarf_convert_type(cup, arg, NULL,
1585 return (ret);
1592 if ((ret = ctf_dwarf_string(cup, arg, DW_AT_name, &name)) != 0)
1593 return (ret);
1601 if ((ret = ctf_dwarf_unsigned(cup, arg, DW_AT_const_value,
1604 } else if ((ret = ctf_dwarf_signed(cup, arg, DW_AT_const_value,
1609 if (ret != 0) {
1610 if (ret != ENOENT)
1611 return (ret);
1618 ret = ctf_add_enumerator(cup->cu_ctfp, id, name, eval);
1619 if (ret == CTF_ERR) {
1639 int ret;
1647 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) != 0) {
1648 if (ret != ENOENT)
1649 return (ret);
1658 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &retdie)) != 0) {
1659 if (ret != ENOENT)
1660 return (ret);
1664 if ((ret = ctf_dwarf_convert_type(cup, retdie, &fi.ctc_return,
1666 return (ret);
1669 if ((ret = ctf_dwarf_function_count(cup, die, &fi, B_TRUE)) != 0) {
1670 return (ret);
1678 if ((ret = ctf_dwarf_convert_fargs(cup, die, &fi, argv)) != 0) {
1680 return (ret);
1698 int ret;
1707 if ((ret = ctf_dwarf_offset(cup, die, &offset)) != 0)
1708 return (ret);
1726 if ((ret = ctf_dwarf_tag(cup, die, &tag)) != 0)
1727 return (ret);
1729 ret = ENOTSUP;
1733 ret = ctf_dwarf_create_base(cup, die, idp, isroot, offset);
1737 ret = ctf_dwarf_create_array(cup, die, idp, isroot);
1741 ret = ctf_dwarf_create_enum(cup, die, idp, isroot);
1745 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_POINTER,
1750 ret = ctf_dwarf_create_sou(cup, die, idp, CTF_K_STRUCT,
1755 ret = ctf_dwarf_create_fptr(cup, die, idp, isroot);
1759 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_TYPEDEF,
1764 ret = ctf_dwarf_create_sou(cup, die, idp, CTF_K_UNION,
1769 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_CONST,
1774 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_VOLATILE,
1779 ret = ctf_dwarf_create_reference(cup, die, idp, CTF_K_RESTRICT,
1784 ret = 0;
1788 ret);
1790 return (ret);
1796 int ret;
1799 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0)
1800 return (ret);
1812 int ret;
1815 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0)
1816 return (ret);
1822 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0)
1823 return (ret);
1840 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name,
1842 return (ret);
1854 if ((ret = ctf_dwarf_sib(cup, arg, &sib)) != 0)
1855 return (ret);
1866 int ret;
1870 if ((ret = ctf_dwarf_child(cup, die, &child)) != 0)
1871 return (ret);
1877 if ((ret = ctf_dwarf_tag(cup, arg, &tag)) != 0)
1878 return (ret);
1882 if ((ret = ctf_dwarf_refdie(cup, arg, DW_AT_type,
1884 return (ret);
1886 if ((ret = ctf_dwarf_convert_type(cup, tdie, &argv[i],
1888 return (ret);
1900 if ((ret = ctf_dwarf_sib(cup, arg, &sib)) != 0)
1901 return (ret);
1911 int ret;
1922 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0) {
1923 if (ret == ENOENT)
1925 return (ret);
1936 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) == 0) {
1937 if ((ret = ctf_dwarf_convert_type(cup, tdie,
1941 return (ret);
1943 } else if (ret != ENOENT) {
1946 return (ret);
1966 if ((ret = ctf_dwarf_function_count(cup, die, &cdf->cdf_fip,
1970 return (ret);
1982 if ((ret = ctf_dwarf_convert_fargs(cup, die,
1987 return (ret);
1993 if ((ret = ctf_dwarf_isglobal(cup, die, &cdf->cdf_global)) != 0) {
1998 return (ret);
2002 return (ret);
2011 int ret;
2019 if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) == 0) {
2022 } else if (ret != ENOENT) {
2023 return (ret);
2033 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_specification,
2036 if ((ret = ctf_dwarf_offset(cup, tdie, &offset)) != 0)
2037 return (ret);
2041 } else if (ret != ENOENT) {
2042 return (ret);
2045 if ((ret = ctf_dwarf_string(cup, die, DW_AT_name, &name)) != 0 &&
2046 ret != ENOENT)
2047 return (ret);
2048 if (ret == ENOENT)
2051 if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) {
2053 return (ret);
2056 if ((ret = ctf_dwarf_convert_type(cup, tdie, &id,
2058 return (ret);
2068 if ((ret = ctf_dwarf_isglobal(cup, die, &cdv->cdv_global)) != 0) {
2071 return (ret);
2084 int ret;
2088 if ((ret = ctf_dwarf_offset(cup, die, &offset)) != 0)
2089 return (ret);
2098 if ((ret = ctf_dwarf_tag(cup, die, &tag)) != 0)
2099 return (ret);
2101 ret = 0;
2105 ret = ctf_dwarf_convert_function(cup, die);
2109 ret = ctf_dwarf_convert_variable(cup, die);
2113 ret = ctf_dwarf_walk_lexical(cup, die);
2120 ret = ctf_dwarf_convert_type(cup, die, NULL, B_TRUE);
2126 return (ret);
2138 int ret;
2141 if ((ret = ctf_dwarf_walk_toplevel(cup, die)) != 0)
2142 return (ret);
2144 if ((ret = ctf_dwarf_sib(cup, die, &sib)) != 0)
2145 return (ret);
2158 int ret;
2161 if ((ret = ctf_dwarf_fixup_sou(cup, map->cdm_die, map->cdm_id,
2163 return (ret);
2227 int ret;
2276 ret = func(cup, gsymp, i, file, name, arg);
2277 if (ret != 0)
2278 return (ret);
2288 int ret, bind, type;
2305 ret = ctf_add_object(cup->cu_ctfp, idx, cdv->cdv_type);
2312 ret = ctf_add_function(cup->cu_ctfp, idx, &cdf->cdf_fip,
2316 if (ret == CTF_ERR) {
2446 int ret;
2469 ret = ctf_add_function(cup->cu_ctfp, idx, &fip, args);
2472 if (ret == CTF_ERR)
2482 int ret, type;
2506 ret = ctf_dwarf_symtab_iter(cup, ctf_dwarf_conv_check_weak, &cweak);
2507 VERIFY(ret == 0 || ret == 1);
2513 if (ret == 0 && cweak.cweak_candidate == B_FALSE) {
2522 ret = ctf_dwarf_duplicate_sym(cup, idx, cweak.cweak_idx);
2524 ret = ctf_dwarf_duplicate_func(cup, idx, cweak.cweak_idx);
2527 return (ret);
2540 int ret;
2548 ret = ctf_dwarf_convert_die(cup, cup->cu_cu);
2550 ret);
2551 if (ret != 0) {
2552 return (ret);
2559 ret = ctf_dwarf_fixup_die(cup, B_FALSE);
2561 ret);
2562 if (ret != 0) {
2563 return (ret);
2570 ret = ctf_dwarf_fixup_die(cup, B_TRUE);
2572 ret);
2573 if (ret != 0) {
2574 return (ret);
2582 if ((ret = ctf_dwarf_conv_funcvars(cup)) != 0) {
2583 return (ctf_dwarf_error(cup, NULL, ret,
2593 if ((ret = ctf_dwarf_conv_weaks(cup)) != 0) {
2594 return (ctf_dwarf_error(cup, NULL, ret,
2606 if ((ret = ctf_merge_add(cup->cu_cmh, cup->cu_ctfp)) != 0) {
2607 return (ctf_dwarf_error(cup, NULL, ret,
2612 if ((ret = ctf_merge_dedup(cup->cu_cmh, &dedup)) != 0) {
2613 return (ctf_dwarf_error(cup, NULL, ret,
2702 int ret;
2706 while ((ret = dwarf_next_cu_header(dw, NULL, &vers, NULL, NULL,
2708 if (ret != DW_DLV_OK) {
2737 int ret;
2743 while ((ret = dwarf_next_cu_header(cup->cu_dwarf, &hdrlen, NULL,
2749 VERIFY(ret == DW_DLV_OK);
2764 cup->cu_ctfp = ctf_fdcreate(fd, &ret);
2767 return (ret);
2777 if ((ret = ctf_dwarf_die_elfenc(elf, cup, errbuf,
2781 return (ret);
2784 if ((ret = ctf_dwarf_sib(cup, NULL, &cu)) != 0) {
2787 return (ret);
2797 if ((ret = ctf_dwarf_child(cup, cu, &child)) != 0) {
2800 return (ret);
2813 if ((cup->cu_cmh = ctf_merge_init(fd, &ret)) == NULL) {
2816 return (ret);
2836 int err, ret, ndies, i;
2847 ret = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw, &derr);
2848 if (ret != DW_DLV_OK) {
2855 if (ret == DW_DLV_NO_ENTRY ||
2876 ret = ctf_dwarf_count_dies(dw, &derr, &ndies, errmsg, errlen);
2877 if (ret != 0) {
2878 *errp = ret;
2891 ret = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL,
2893 if (ret != 0) {
2902 ret = ctf_dwarf_init_die(fd, elf, &cdies[i], i, errmsg, errlen);
2903 if (ret != 0) {
2904 *errp = ret;
2935 ret = workq_work(wqp, ctf_dwarf_convert_one, NULL, errp);
2936 if (ret == WORKQ_ERROR) {
2939 } else if (ret == WORKQ_UERROR) {
2949 cmp = ctf_merge_init(fd, &ret);
2951 *errp = ret;
2956 if ((ret = ctf_merge_set_nthreads(cmp, nthrs)) != 0) {
2958 *errp = ret;
2965 if ((ret = ctf_merge_add(cmp, cup->cu_ctfp)) != 0) {
2967 *errp = ret;
2973 ret = ctf_merge_merge(cmp, fpp);
2974 if (ret != 0) {
2978 *errp = ret;