Changeset 53655 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv
- Timestamp:
- Jan 2, 2015 12:27:57 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cc.c
r53634 r53655 81 81 */ 82 82 83 #ifndef VBOX 83 84 #include <sys/types.h> 84 85 #include <sys/wait.h> … … 95 96 #include <ctype.h> 96 97 #include <dirent.h> 98 #else /* VBOX */ 99 # include <ctype.h> 100 # include <iprt/dir.h> 101 # ifdef _MSC_VER 102 # include <io.h> 103 # define ftruncate64 _chsize 104 # define lseek64 lseek 105 # else 106 # include <unistd.h> 107 # endif 108 #endif /* VBOX */ 97 109 #include <dt_module.h> 98 110 #include <dt_program.h> … … 1429 1441 const dtrace_pattr_t *pap; 1430 1442 dt_probe_t *prp; 1443 #ifndef VBOX 1431 1444 dt_provider_t *pvp; 1445 #endif 1432 1446 dt_ident_t *idp; 1433 1447 char attrstr[8]; 1434 1448 int err; 1435 1449 1450 #ifndef VBOX 1436 1451 /* 1437 1452 * Both kernel and pid based providers are allowed to have names … … 1452 1467 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER); 1453 1468 } 1469 #endif 1454 1470 1455 1471 /* … … 1583 1599 dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) 1584 1600 { 1601 #ifndef VBOX 1585 1602 int argc = dtp->dt_cpp_argc; 1586 1603 char **argv = malloc(sizeof (char *) * (argc + 5)); … … 1707 1724 (void) fclose(ofp); 1708 1725 return (NULL); 1726 #else /* VBOX */ 1727 (void) dt_set_errno(dtp, EDT_CPPERR); 1728 return (NULL); 1729 #endif /* VBOX */ 1709 1730 } 1710 1731 … … 1927 1948 dt_load_libs_dir(dtrace_hdl_t *dtp, const char *path) 1928 1949 { 1950 #ifndef VBOX 1929 1951 struct dirent *dp; 1930 1952 const char *p; 1931 1953 DIR *dirp; 1954 #else 1955 PRTDIR pDir; 1956 RTDIRENTRY DirEntry; 1957 const char *p; 1958 int rc; 1959 #endif 1932 1960 1933 1961 char fname[PATH_MAX]; … … 1937 1965 dt_lib_depend_t *dld; 1938 1966 1967 #ifndef VBOX 1939 1968 if ((dirp = opendir(path)) == NULL) { 1940 1969 dt_dprintf("skipping lib dir %s: %s\n", path, strerror(errno)); 1941 1970 return (0); 1942 1971 } 1972 #else 1973 rc = RTDirOpen(&pDir, path); 1974 if (RT_FAILURE(rc)) { 1975 dt_dprintf("skipping lib dir %s: %s\n", path, RTErrGetShort(rc)); 1976 return (0); 1977 } 1978 #endif 1943 1979 1944 1980 /* First, parse each file for library dependencies. */ 1981 #ifndef VBOX 1945 1982 while ((dp = readdir(dirp)) != NULL) { 1983 #else 1984 while (RT_SUCCESS(RTDirRead(pDir, &DirEntry, 0))) { 1985 struct FakeDirEntry { 1986 const char *d_name; 1987 } FakeDirEntry = { DirEntry.szName }, *dp = &FakeDirEntry; 1988 #endif 1946 1989 if ((p = strrchr(dp->d_name, '.')) == NULL || strcmp(p, ".d")) 1947 1990 continue; /* skip any filename not ending in .d */ … … 1977 2020 } 1978 2021 2022 #ifndef VBOX 1979 2023 (void) closedir(dirp); 2024 #else 2025 RTDirClose(pDir); 2026 #endif 1980 2027 /* 1981 2028 * Finish building the graph containing the library dependencies -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cg.c
r53653 r53655 478 478 479 479 dif_instr_t instr; 480 #ifndef VBOX 480 481 int reg, n; 482 #else 483 int reg; 484 uint64_t n; 485 #endif 481 486 482 487 if (dt_node_is_scalar(dst) && (dstsize < srcsize || … … 522 527 const dt_idsig_t *isp = idp->di_data; 523 528 dt_node_t *dnp; 524 inti = 0;529 VBDTTYPE(uint_t,int) i = 0; 525 530 526 531 for (dnp = args; dnp != NULL; dnp = dnp->dn_list) … … 1218 1223 uint_t op; 1219 1224 size_t size; 1225 #ifndef VBOX 1220 1226 int reg, n; 1227 #else 1228 int reg; 1229 uint64_t n; 1230 #endif 1221 1231 1222 1232 assert(dnp->dn_kind == DT_NODE_VAR); … … 1860 1870 dtrace_hdl_t *dtp = yypcb->pcb_hdl; 1861 1871 dtrace_syminfo_t *sip = dnp->dn_ident->di_data; 1872 #ifndef VBOX 1862 1873 GElf_Sym sym; 1863 1874 1864 1875 if (dtrace_lookup_by_name(dtp, 1865 1876 sip->dts_object, sip->dts_name, &sym, NULL) == -1) { 1877 #endif 1866 1878 xyerror(D_UNKNOWN, "cg failed for symbol %s`%s:" 1867 1879 " %s\n", sip->dts_object, sip->dts_name, 1868 1880 dtrace_errmsg(dtp, dtrace_errno(dtp))); 1881 #ifndef VBOX 1869 1882 } 1870 1883 … … 1881 1894 dt_cg_node_alloc(DT_LBL_NONE, instr)); 1882 1895 } 1896 #endif 1883 1897 break; 1884 1898 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_consume.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <stdlib.h> 27 28 #include <strings.h> … … 32 33 #include <ctype.h> 33 34 #include <alloca.h> 35 #else /* VBOX */ 36 # include <ctype.h> 37 # include <iprt/mp.h> 38 # ifdef _MSC_VER 39 # pragma warning(disable:4146) /* -uint64_t warnings */ 40 # include <io.h> 41 # define ftruncate _chsize 42 # define fseeko fseek 43 # else 44 # include <unistd.h> 45 # endif 46 #endif /* VBOX */ 34 47 #include <dt_impl.h> 35 48 … … 385 398 static const char *r_str[2] = { " <- ", " <= " }; 386 399 static const char *ent = "entry", *ret = "return"; 387 static intentlen = 0, retlen = 0;400 static VBDTTYPE(size_t,int) entlen = 0, retlen = 0; 388 401 dtrace_epid_t next, id = epd->dtepd_epid; 389 402 int rval; … … 824 837 caddr_t addr, int depth, int size) 825 838 { 839 #ifndef VBOX 826 840 dtrace_syminfo_t dts; 827 841 GElf_Sym sym; 842 #endif 828 843 int i, indent; 829 844 char c[PATH_MAX * 2]; … … 857 872 } 858 873 859 if (pc == NULL)874 if (pc == 0 /*VBOX: NULL is a ptr */) 860 875 break; 861 876 … … 865 880 return (-1); 866 881 882 #ifndef VBOX 867 883 if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { 868 884 if (pc > sym.st_value) { … … 884 900 dts.dts_object, pc); 885 901 } else { 902 #endif 886 903 (void) snprintf(c, sizeof (c), "0x%llx", pc); 904 #ifndef VBOX 887 905 } 888 906 } 907 #endif 889 908 890 909 if (dt_printf(dtp, fp, format, c) < 0) … … 910 929 int err = 0; 911 930 931 #ifndef VBOX 912 932 char name[PATH_MAX], objname[PATH_MAX], c[PATH_MAX * 2]; 913 933 struct ps_prochandle *P; 914 934 GElf_Sym sym; 935 #else 936 char c[PATH_MAX * 2]; 937 #endif 915 938 int i, indent; 916 939 pid_t pid; … … 937 960 * this is a vector open, we just print the raw address or string. 938 961 */ 962 #ifndef VBOX 939 963 if (dtp->dt_vector == NULL) 940 964 P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0); … … 944 968 if (P != NULL) 945 969 dt_proc_lock(dtp, P); /* lock handle while we perform lookups */ 946 947 for (i = 0; i < depth && pc[i] != NULL; i++) { 970 #endif 971 972 for (i = 0; VBDTCAST(uint_t)i < depth && pc[i] != 0/*NULL*/; i++) { 973 #ifndef VBOX 948 974 const prmap_t *map; 975 #endif 949 976 950 977 if ((err = dt_printf(dtp, fp, "%*s", indent, "")) < 0) 951 978 break; 952 979 980 #ifndef VBOX 953 981 if (P != NULL && Plookup_by_addr(P, pc[i], 954 982 name, sizeof (name), &sym) == 0) { … … 986 1014 dt_basename(objname), (u_longlong_t)pc[i]); 987 1015 } else { 1016 #else 1017 { { 1018 #endif 988 1019 (void) snprintf(c, sizeof (c), "0x%llx", 989 1020 (u_longlong_t)pc[i]); … … 1023 1054 } 1024 1055 1056 #ifndef VBOX 1025 1057 if (P != NULL) { 1026 1058 dt_proc_unlock(dtp, P); 1027 1059 dt_proc_release(dtp, P); 1028 1060 } 1061 #endif 1029 1062 1030 1063 return (err); … … 1042 1075 int n, len = 256; 1043 1076 1077 #ifndef VBOX 1044 1078 if (act == DTRACEACT_USYM && dtp->dt_vector == NULL) { 1045 1079 struct ps_prochandle *P; … … 1058 1092 } 1059 1093 } 1094 #endif 1060 1095 1061 1096 do { … … 1076 1111 int err = 0; 1077 1112 1113 #ifndef VBOX 1078 1114 char objname[PATH_MAX], c[PATH_MAX * 2]; 1079 1115 struct ps_prochandle *P; 1116 #else 1117 char c[64]; 1118 #endif 1080 1119 1081 1120 if (format == NULL) 1082 1121 format = " %-50s"; 1083 1122 1123 #ifndef VBOX 1084 1124 /* 1085 1125 * See the comment in dt_print_ustack() for the rationale for … … 1106 1146 dt_proc_release(dtp, P); 1107 1147 } 1148 #else /* VBOX */ 1149 snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc); 1150 err = dt_printf(dtp, fp, format, c); 1151 #endif /* VBOX */ 1108 1152 1109 1153 return (err); … … 1115 1159 /* LINTED - alignment */ 1116 1160 uint64_t pc = *((uint64_t *)addr); 1161 #ifndef VBOX 1117 1162 dtrace_syminfo_t dts; 1118 1163 GElf_Sym sym; 1119 1164 char c[PATH_MAX * 2]; 1165 #else 1166 char c[64]; 1167 #endif 1120 1168 1121 1169 if (format == NULL) 1122 1170 format = " %-50s"; 1123 1171 1172 #ifndef VBOX 1124 1173 if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { 1125 1174 (void) snprintf(c, sizeof (c), "%s`%s", … … 1139 1188 } 1140 1189 } 1190 #else 1191 snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc); 1192 #endif 1141 1193 1142 1194 if (dt_printf(dtp, fp, format, c) < 0) … … 1151 1203 /* LINTED - alignment */ 1152 1204 uint64_t pc = *((uint64_t *)addr); 1205 #ifndef VBOX 1153 1206 dtrace_syminfo_t dts; 1207 #endif 1154 1208 char c[PATH_MAX * 2]; 1155 1209 … … 1157 1211 format = " %-50s"; 1158 1212 1213 #ifndef VBOX 1159 1214 if (dtrace_lookup_by_addr(dtp, pc, NULL, &dts) == 0) { 1160 1215 (void) snprintf(c, sizeof (c), "%s", dts.dts_object); 1161 } else { 1216 } else 1217 #endif 1218 { 1162 1219 (void) snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc); 1163 1220 } … … 1541 1598 const char *option, const char *value) 1542 1599 { 1600 #ifndef VBOX 1543 1601 int len, rval; 1602 #else 1603 size_t len; 1604 int rval; 1605 #endif 1544 1606 char *msg; 1545 1607 const char *errstr; … … 2123 2185 2124 2186 if (max_ncpus == 0) 2187 #ifndef VBOX 2125 2188 max_ncpus = dt_sysconf(dtp, _SC_CPUID_MAX) + 1; 2189 #else 2190 max_ncpus = RTMpGetMaxCpuId() + 1; 2191 #endif 2126 2192 2127 2193 for (i = 0; i < max_ncpus; i++) { … … 2189 2255 2190 2256 if (dtp->dt_lastswitch != 0) { 2191 if (now - dtp->dt_lastswitch < interval)2257 if (now - dtp->dt_lastswitch < VBDTCAST(hrtime_t)interval) 2192 2258 return (0); 2193 2259 … … 2201 2267 2202 2268 if (max_ncpus == 0) 2269 #ifndef VBOX 2203 2270 max_ncpus = dt_sysconf(dtp, _SC_CPUID_MAX) + 1; 2271 #else 2272 max_ncpus = RTMpGetMaxCpuId() + 1; 2273 #endif 2204 2274 2205 2275 if (pf == NULL) -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <strings.h> 27 28 #include <stdlib.h> … … 29 30 #include <alloca.h> 30 31 #include <assert.h> 32 #endif 31 33 32 34 #include <dt_decl.h> … … 701 703 int value; 702 704 705 #ifndef VBOX 703 706 name = strdupa(s); 707 #else 708 MY_STRDUPA(name, s); 709 #endif 704 710 free(s); 705 711 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dis.c
r53634 r53655 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 29 30 #include <strings.h> 30 31 #include <stdio.h> 32 #endif 31 33 32 34 #include <dt_impl.h> … … 120 122 case 't': return (DIFV_SCOPE_THREAD); 121 123 case 'g': return (DIFV_SCOPE_GLOBAL); 122 default: return ( -1u);124 default: return (~0u /*VBOX: was -1u*/); 123 125 } 124 126 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <sys/types.h> 27 28 #include <sys/sysmacros.h> … … 33 34 #include <errno.h> 34 35 #include <limits.h> 36 #else /* VBOX */ 37 # include <iprt/asm.h> 38 #endif /* VBOX */ 35 39 36 40 #include <dt_impl.h> … … 191 195 { 192 196 dt_buf_t *bp = &ddo->ddo_strs; 193 dof_stridx_t i = dt_buf_len(bp);197 dof_stridx_t i = VBDTCAST(dof_stridx_t)dt_buf_len(bp); 194 198 195 199 if (i != 0 && (s == NULL || *s == '\0')) … … 406 410 dofpr.dofpr_addr = 0; 407 411 dofpr.dofpr_name = dof_add_string(ddo, prp->pr_name); 408 dofpr.dofpr_nargv = dt_buf_len(&ddo->ddo_strs);412 dofpr.dofpr_nargv = VBDTCAST(dof_stridx_t)dt_buf_len(&ddo->ddo_strs); 409 413 410 414 for (dnp = prp->pr_nargs; dnp != NULL; dnp = dnp->dn_list) { … … 413 417 } 414 418 415 dofpr.dofpr_xargv = dt_buf_len(&ddo->ddo_strs);419 dofpr.dofpr_xargv = VBDTCAST(dof_stridx_t)dt_buf_len(&ddo->ddo_strs); 416 420 417 421 for (dnp = prp->pr_xargs; dnp != NULL; dnp = dnp->dn_list) { … … 420 424 } 421 425 422 dofpr.dofpr_argidx = dt_buf_len(&ddo->ddo_args) / sizeof (uint8_t);426 dofpr.dofpr_argidx = VBDTCAST(uint32_t)dt_buf_len(&ddo->ddo_args) / sizeof (uint8_t); 423 427 424 428 for (i = 0; i < prp->pr_xargc; i++) { … … 446 450 447 451 dofpr.dofpr_offidx = 448 dt_buf_len(&ddo->ddo_offs) / sizeof (uint32_t);452 VBDTCAST(uint32_t)(dt_buf_len(&ddo->ddo_offs) / sizeof (uint32_t)); 449 453 dofpr.dofpr_noffs = pip->pi_noffs; 450 454 dt_buf_write(dtp, &ddo->ddo_offs, pip->pi_offs, … … 452 456 453 457 dofpr.dofpr_enoffidx = 454 dt_buf_len(&ddo->ddo_enoffs) / sizeof (uint32_t);458 VBDTCAST(uint32_t)(dt_buf_len(&ddo->ddo_enoffs) / sizeof (uint32_t)); 455 459 dofpr.dofpr_nenoffs = pip->pi_nenoffs; 456 460 dt_buf_write(dtp, &ddo->ddo_enoffs, pip->pi_enoffs, … … 663 667 664 668 if (sdp->dtsd_fmtdata != NULL) { 665 i = dtrace_printf_format(dtp,669 i = VBDTCAST(uint_t)dtrace_printf_format(dtp, 666 670 sdp->dtsd_fmtdata, NULL, 0); 667 671 maxfmt = MAX(maxfmt, i); … … 822 826 (void) dof_add_usect(ddo, _dtrace_version, DOF_SECT_COMMENTS, 823 827 sizeof (char), 0, 0, strlen(_dtrace_version) + 1); 828 #ifndef VBOX 824 829 (void) dof_add_usect(ddo, &dtp->dt_uts, DOF_SECT_UTSNAME, 825 830 sizeof (char), 0, 0, sizeof (struct utsname)); 831 #endif 826 832 } 827 833 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_handle.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #pragma ident "%Z%%M% %I% %E% SMI" 27 28 … … 33 34 #include <assert.h> 34 35 #include <alloca.h> 36 #endif 35 37 36 38 #include <dt_impl.h> … … 157 159 const char *faultstr; 158 160 char *str; 159 intlen;161 VBDTTYPE(size_t,int) len; 160 162 161 163 assert(epd->dtepd_uarg == DT_ECB_ERROR); … … 240 242 const int slop = 80; 241 243 char *str; 242 intlen;244 VBDTTYPE(size_t,int) len; 243 245 244 246 err.dteda_edesc = data->dtpda_edesc; … … 248 250 err.dteda_offset = -1; 249 251 err.dteda_fault = DTRACEFLT_LIBRARY; 250 err.dteda_addr = NULL;252 err.dteda_addr = 0 /*NULL*/; 251 253 252 254 len = strlen(faultstr) + … … 313 315 dtrace_dropdata_t drop; 314 316 char str[80], *s; 315 intsize;317 VBDTTYPE(size_t,int) size; 316 318 317 319 assert(what == DTRACEDROP_PRINCIPAL || what == DTRACEDROP_AGGREGATION); … … 420 422 dt_droptag(_dt_droptab[i].dtdrt_kind)); 421 423 s = &str[strlen(str)]; 422 size = sizeof (str) - (s - str);424 size = VBDTCAST(int)sizeof (str) - (s - str); 423 425 } else { 424 426 s = str; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_ident.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <sys/sysmacros.h> 27 28 #include <strings.h> … … 33 34 #include <sys/procfs_isa.h> 34 35 #include <limits.h> 36 #else /* VBOX */ 37 # include <ctype.h> 38 #endif /* VBOX */ 35 39 36 40 #include <dt_ident.h> … … 179 183 180 184 assert(idp->di_iarg != NULL); 185 #ifndef VBOX 181 186 s = strdupa(idp->di_iarg); 187 #else 188 MY_STRDUPA(s, idp->di_iarg); 189 #endif 182 190 183 191 if ((p2 = strrchr(s, ')')) != NULL) -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_inttab.c
r53634 r53655 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 29 30 #include <assert.h> 31 #endif 30 32 31 33 #include <dt_inttab.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_map.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #pragma ident "%Z%%M% %I% %E% SMI" 27 28 … … 31 32 #include <unistd.h> 32 33 #include <assert.h> 34 #endif 33 35 34 36 #include <dt_impl.h> … … 43 45 dtrace_probedesc_t *probe; 44 46 45 while (id >= (max = dtp->dt_maxprobe) || dtp->dt_pdesc == NULL) {47 while (id >= (max = VBDTCAST(dtrace_id_t)dtp->dt_maxprobe) || dtp->dt_pdesc == NULL) { 46 48 dtrace_id_t new_max = max ? (max << 1) : 1; 47 49 size_t nsize = new_max * sizeof (void *); … … 293 295 int rval; 294 296 295 while (id >= (max = dtp->dt_maxagg) || dtp->dt_aggdesc == NULL) {297 while (id >= (max = VBDTCAST(dtrace_id_t)dtp->dt_maxagg) || dtp->dt_aggdesc == NULL) { 296 298 dtrace_id_t new_max = max ? (max << 1) : 1; 297 299 size_t nsize = new_max * sizeof (void *); … … 360 362 */ 361 363 if (dtp->dt_options[DTRACEOPT_GRABANON] == DTRACEOPT_UNSET && 362 agg->dtagd_rec[0].dtrd_uarg != NULL) {364 agg->dtagd_rec[0].dtrd_uarg != 0 /*NULL*/) { 363 365 dtrace_stmtdesc_t *sdp; 364 366 dt_ident_t *aid; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_module.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <sys/types.h> 27 28 #include <sys/modctl.h> … … 41 42 #include <errno.h> 42 43 #include <dirent.h> 44 #else /* VBOX */ 45 #endif /* VBOX */ 43 46 44 47 #include <dt_strtab.h> 45 48 #include <dt_module.h> 46 49 #include <dt_impl.h> 50 51 #ifndef VBOX /** @todo port what is necessary here ! */ 47 52 48 53 static const char *dt_module_strtab; /* active strtab for qsort callbacks */ … … 1312 1317 return (0); 1313 1318 } 1319 1320 #endif /* !VBOX */ -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_parser.c
r53634 r53655 92 92 */ 93 93 94 #ifndef VBOX 94 95 #include <sys/param.h> 95 96 #include <limits.h> … … 103 104 #include <errno.h> 104 105 #include <ctype.h> 106 #else /* VBOX */ 107 # include <ctype.h> 108 # ifdef _MSC_VER 109 # pragma warning(disable:4146) /* -unsigned */ 110 # pragma warning(disable:4267) /* size_t to int */ 111 # endif 112 #endif /* VBOX */ 105 113 106 114 #include <dt_impl.h> … … 761 769 dt_node_sizeof(const dt_node_t *dnp) 762 770 { 771 #ifndef VBOX 763 772 dtrace_syminfo_t *sip; 764 773 GElf_Sym sym; 774 #endif 765 775 dtrace_hdl_t *dtp = yypcb->pcb_hdl; 766 776 … … 777 787 return (dt_node_type_size(dnp)); 778 788 789 #ifndef VBOX 779 790 sip = dnp->dn_ident->di_data; 780 791 … … 784 795 785 796 return (sym.st_size); 797 #else 798 return (0); 799 #endif 786 800 } 787 801 … … 1423 1437 1424 1438 case DT_DC_EXTERN: { 1439 #ifndef VBOX 1425 1440 dtrace_typeinfo_t ott; 1426 1441 dtrace_syminfo_t dts; … … 1445 1460 "failed to extern %s: %s\n", dsp->ds_ident, 1446 1461 dtrace_errmsg(dtp, dtrace_errno(dtp))); 1447 } else { 1462 } else 1463 #endif 1464 { 1465 1448 1466 dt_dprintf("extern %s`%s type=<%s>\n", 1449 1467 dmp->dm_name, dsp->ds_ident, … … 1753 1771 uint_t kind; 1754 1772 1773 #ifndef VBOX 1755 1774 name = strdupa(s); 1775 #else 1776 MY_STRDUPA(name, s); 1777 #endif 1756 1778 free(s); 1757 1779 … … 2570 2592 dtrace_attribute_t attr = _dtrace_defattr; 2571 2593 dt_ident_t *idp; 2594 #ifndef VBOX 2572 2595 dtrace_syminfo_t dts; 2573 2596 GElf_Sym sym; 2597 #endif 2574 2598 2575 2599 const char *scope, *mark; … … 2660 2684 dt_node_attr_assign(dnp, attr); 2661 2685 2686 #ifndef VBOX 2662 2687 } else if (dhp == dtp->dt_globals && scope != DTRACE_OBJ_EXEC && 2663 2688 dtrace_lookup_by_name(dtp, scope, name, &sym, &dts) == 0) { … … 2728 2753 dnp->dn_flags |= DT_NF_USERLAND; 2729 2754 } 2730 2755 #endif /* !VBOX */ 2731 2756 } else if (scope == DTRACE_OBJ_EXEC && create == B_TRUE) { 2732 2757 uint_t flags = DT_IDFLG_WRITE; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.c
r53634 r53655 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 /* … … 45 47 */ 46 48 49 #ifndef VBOX 47 50 #include <strings.h> 48 51 #include <stdlib.h> 49 52 #include <assert.h> 53 #endif 50 54 51 55 #include <dt_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pragma.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <assert.h> 27 28 #include <strings.h> … … 29 30 #include <stdlib.h> 30 31 #include <stdio.h> 32 #endif 31 33 32 34 #include <dt_parser.h> … … 335 337 } 336 338 339 #ifndef VBOX 337 340 opt = strdupa(dnp->dn_string); 341 #else 342 MY_STRDUPA(opt, dnp->dn_string); 343 #endif 338 344 339 345 if ((val = strchr(opt, '=')) != NULL) -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_program.c
r53634 r53655 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <unistd.h> 27 28 #include <strings.h> … … 31 32 #include <ctype.h> 32 33 #include <alloca.h> 34 #else 35 # include <ctype.h> 36 #endif 33 37 34 38 #include <dt_impl.h> … … 455 459 char *mname, *fname; 456 460 const char *p; 457 inti;461 VBDTTYPE(uint_t,int) i; 458 462 459 463 p = prp->pr_name; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_provider.c
r53634 r53655 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 … … 37 38 #include <unistd.h> 38 39 #include <errno.h> 40 #else /* VBOX */ 41 # include <iprt/asm.h> 42 #endif /* VBOX */ 39 43 40 44 #include <dt_provider.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c
r53653 r53655 227 227 dtrace_class_t c; 228 228 char *p, *q; 229 #ifdef VBOX230 size_t cbStr;231 #endif232 229 233 230 if (str == NULL || attr == NULL) … … 238 235 p = strdupa(str); 239 236 #else 240 cbStr = strlen(str) + 1; 241 p = alloca(cbStr); 242 memcpy(p, str, cbStr); 237 MY_STRDUPA(p, str); 243 238 #endif 244 239 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_xlator.c
r53634 r53655 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 29 30 #include <strings.h> 30 31 #include <assert.h> 32 #endif 31 33 32 34 #include <dt_xlator.h>
Note:
See TracChangeset
for help on using the changeset viewer.