Changeset 53659 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace
- Timestamp:
- Jan 2, 2015 12:31:09 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_aggregate.c
r53652 r53659 309 309 dt_aggregate_sym(dtrace_hdl_t *dtp, uint64_t *data) 310 310 { 311 #ifndef VBOX312 311 GElf_Sym sym; 313 312 uint64_t *pc = data; … … 315 314 if (dtrace_lookup_by_addr(dtp, *pc, &sym, NULL) == 0) 316 315 *pc = sym.st_value; 317 #endif318 316 } 319 317 … … 321 319 dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *data) 322 320 { 323 #ifndef VBOX324 321 uint64_t *pc = data; 325 322 dt_module_t *dmp; … … 344 341 } 345 342 } 346 #endif347 343 } 348 344 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cg.c
r53655 r53659 1870 1870 dtrace_hdl_t *dtp = yypcb->pcb_hdl; 1871 1871 dtrace_syminfo_t *sip = dnp->dn_ident->di_data; 1872 #ifndef VBOX1873 1872 GElf_Sym sym; 1874 1873 1875 1874 if (dtrace_lookup_by_name(dtp, 1876 1875 sip->dts_object, sip->dts_name, &sym, NULL) == -1) { 1877 #endif1878 1876 xyerror(D_UNKNOWN, "cg failed for symbol %s`%s:" 1879 1877 " %s\n", sip->dts_object, sip->dts_name, 1880 1878 dtrace_errmsg(dtp, dtrace_errno(dtp))); 1881 #ifndef VBOX1882 1879 } 1883 1880 … … 1894 1891 dt_cg_node_alloc(DT_LBL_NONE, instr)); 1895 1892 } 1896 #endif1897 1893 break; 1898 1894 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_consume.c
r53655 r53659 837 837 caddr_t addr, int depth, int size) 838 838 { 839 #ifndef VBOX840 839 dtrace_syminfo_t dts; 841 840 GElf_Sym sym; 842 #endif843 841 int i, indent; 844 842 char c[PATH_MAX * 2]; … … 880 878 return (-1); 881 879 882 #ifndef VBOX883 880 if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { 884 881 if (pc > sym.st_value) { … … 900 897 dts.dts_object, pc); 901 898 } else { 902 #endif903 899 (void) snprintf(c, sizeof (c), "0x%llx", pc); 904 #ifndef VBOX905 900 } 906 901 } 907 #endif908 902 909 903 if (dt_printf(dtp, fp, format, c) < 0) … … 1159 1153 /* LINTED - alignment */ 1160 1154 uint64_t pc = *((uint64_t *)addr); 1161 #ifndef VBOX1162 1155 dtrace_syminfo_t dts; 1163 1156 GElf_Sym sym; 1164 1157 char c[PATH_MAX * 2]; 1165 #else1166 char c[64];1167 #endif1168 1158 1169 1159 if (format == NULL) 1170 1160 format = " %-50s"; 1171 1161 1172 #ifndef VBOX1173 1162 if (dtrace_lookup_by_addr(dtp, pc, &sym, &dts) == 0) { 1174 1163 (void) snprintf(c, sizeof (c), "%s`%s", … … 1188 1177 } 1189 1178 } 1190 #else1191 snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc);1192 #endif1193 1179 1194 1180 if (dt_printf(dtp, fp, format, c) < 0) … … 1203 1189 /* LINTED - alignment */ 1204 1190 uint64_t pc = *((uint64_t *)addr); 1205 #ifndef VBOX1206 1191 dtrace_syminfo_t dts; 1207 #endif1208 1192 char c[PATH_MAX * 2]; 1209 1193 … … 1211 1195 format = " %-50s"; 1212 1196 1213 #ifndef VBOX1214 1197 if (dtrace_lookup_by_addr(dtp, pc, NULL, &dts) == 0) { 1215 1198 (void) snprintf(c, sizeof (c), "%s", dts.dts_object); 1216 } else 1217 #endif 1218 { 1199 } else { 1219 1200 (void) snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc); 1220 1201 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_impl.h
r53653 r53659 87 87 uint_t (*do_syminit)(struct dt_module *); 88 88 void (*do_symsort)(struct dt_module *); 89 #ifndef VBOX90 89 GElf_Sym *(*do_symname)(struct dt_module *, 91 90 const char *, GElf_Sym *, uint_t *); 92 91 GElf_Sym *(*do_symaddr)(struct dt_module *, 93 92 GElf_Addr, GElf_Sym *, uint_t *); 94 #endif95 93 } dt_modops_t; 96 94 … … 133 131 uint_t dm_flags; /* module flags (see below) */ 134 132 int dm_modid; /* modinfo(1M) module identifier */ 135 #ifndef VBOX136 133 GElf_Addr dm_text_va; /* virtual address of text section */ 137 134 GElf_Xword dm_text_size; /* size in bytes of text section */ … … 140 137 GElf_Addr dm_bss_va; /* virtual address of BSS */ 141 138 GElf_Xword dm_bss_size; /* size in bytes of BSS */ 142 #endif143 139 dt_idhash_t *dm_extern; /* external symbol definitions */ 144 140 } dt_module_t; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_module.c
r53655 r53659 43 43 #include <dirent.h> 44 44 #else /* VBOX */ 45 # include "../../../../../../Runtime/include/internal/ldrELF32.h" 46 # ifdef _MSC_VER 47 # include <process.h> 48 # define getuid() 0 49 # define getgid() 0 50 # define geteuid() 0 51 # define getegid() 0 52 # define getpid() _getpid() 53 # define getppid() 0 54 55 # define getpgid(a) 0 56 # define getsid(a) 0 57 # else 58 # include <unistd.h> 59 # endif 60 # define getprojid() 0 61 # define gettaskid() 0 62 45 63 #endif /* VBOX */ 46 64 … … 49 67 #include <dt_impl.h> 50 68 51 #ifndef VBOX /** @todo port what is necessary here ! */52 69 53 70 static const char *dt_module_strtab; /* active strtab for qsort callbacks */ … … 474 491 dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp) 475 492 { 493 #ifndef VBOX /** @todo consider this later */ 476 494 const char *s; 477 495 size_t shstrs; … … 507 525 dmp->dm_name, ctsp->cts_name, (ulong_t)ctsp->cts_size); 508 526 527 #endif /* !VBOX */ 509 528 return (0); 510 529 } … … 561 580 */ 562 581 dmp->dm_nsymelems = 563 dmp->dm_symtab.cts_size / dmp->dm_symtab.cts_entsize;582 VBDTCAST(uint_t)(dmp->dm_symtab.cts_size / dmp->dm_symtab.cts_entsize); 564 583 565 584 dmp->dm_nsymbuckets = _dtrace_strbuckets; … … 702 721 dmp->dm_aslen = 0; 703 722 704 dmp->dm_text_va = NULL;723 dmp->dm_text_va = 0/*NULL*/; 705 724 dmp->dm_text_size = 0; 706 dmp->dm_data_va = NULL;725 dmp->dm_data_va = 0/*NULL*/; 707 726 dmp->dm_data_size = 0; 708 dmp->dm_bss_va = NULL;727 dmp->dm_bss_va = 0/*NULL*/; 709 728 dmp->dm_bss_size = 0; 710 729 … … 714 733 } 715 734 735 #ifndef VBOX 716 736 (void) elf_end(dmp->dm_elf); 717 737 dmp->dm_elf = NULL; 738 #endif 718 739 719 740 dmp->dm_flags &= ~DT_DM_LOADED; … … 812 833 dt_module_update(dtrace_hdl_t *dtp, const char *name) 813 834 { 835 #ifndef VBOX 814 836 char fname[MAXPATHLEN]; 815 837 struct stat64 st; … … 903 925 dt_dprintf("opened %d-bit module %s (%s) [%d]\n", 904 926 bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid); 927 #endif /* !VBOX */ 905 928 } 906 929 … … 912 935 dtrace_update(dtrace_hdl_t *dtp) 913 936 { 937 #ifndef VBOX 914 938 dt_module_t *dmp; 915 939 DIR *dirp; … … 934 958 (void) closedir(dirp); 935 959 } 960 #endif /* !VBOX */ 936 961 937 962 /* … … 1318 1343 } 1319 1344 1320 #endif /* !VBOX */ -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_parser.c
r53655 r53659 769 769 dt_node_sizeof(const dt_node_t *dnp) 770 770 { 771 #ifndef VBOX772 771 dtrace_syminfo_t *sip; 773 772 GElf_Sym sym; 774 #endif775 773 dtrace_hdl_t *dtp = yypcb->pcb_hdl; 776 774 … … 787 785 return (dt_node_type_size(dnp)); 788 786 789 #ifndef VBOX790 787 sip = dnp->dn_ident->di_data; 791 788 … … 795 792 796 793 return (sym.st_size); 797 #else798 return (0);799 #endif800 794 } 801 795 … … 1437 1431 1438 1432 case DT_DC_EXTERN: { 1439 #ifndef VBOX1440 1433 dtrace_typeinfo_t ott; 1441 1434 dtrace_syminfo_t dts; … … 1460 1453 "failed to extern %s: %s\n", dsp->ds_ident, 1461 1454 dtrace_errmsg(dtp, dtrace_errno(dtp))); 1462 } else 1463 #endif 1464 { 1465 1455 } else { 1466 1456 dt_dprintf("extern %s`%s type=<%s>\n", 1467 1457 dmp->dm_name, dsp->ds_ident, … … 2592 2582 dtrace_attribute_t attr = _dtrace_defattr; 2593 2583 dt_ident_t *idp; 2594 #ifndef VBOX2595 2584 dtrace_syminfo_t dts; 2596 2585 GElf_Sym sym; 2597 #endif2598 2586 2599 2587 const char *scope, *mark; … … 2684 2672 dt_node_attr_assign(dnp, attr); 2685 2673 2686 #ifndef VBOX2687 2674 } else if (dhp == dtp->dt_globals && scope != DTRACE_OBJ_EXEC && 2688 2675 dtrace_lookup_by_name(dtp, scope, name, &sym, &dts) == 0) { … … 2753 2740 dnp->dn_flags |= DT_NF_USERLAND; 2754 2741 } 2755 #endif /* !VBOX */2756 2742 } else if (scope == DTRACE_OBJ_EXEC && create == B_TRUE) { 2757 2743 uint_t flags = DT_IDFLG_WRITE; -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c
r53655 r53659 861 861 dtrace_addr2str(dtrace_hdl_t *dtp, uint64_t addr, char *str, int nbytes) 862 862 { 863 #ifndef VBOX864 863 dtrace_syminfo_t dts; 865 864 GElf_Sym sym; … … 893 892 } 894 893 } 895 #else896 char s[32];897 RTStrPrintf(s, sizeof(s), "0x%llx", (uint64_t)addr);898 #endif899 894 900 895 return (dt_string2str(s, str, nbytes)); -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dtrace.h
r53653 r53659 451 451 uint_t dto_flags; /* object flags (see below) */ 452 452 453 #ifndef VBOX454 453 GElf_Addr dto_text_va; /* address of text section */ 455 454 GElf_Xword dto_text_size; /* size of text section */ … … 458 457 GElf_Addr dto_bss_va; /* address of BSS */ 459 458 GElf_Xword dto_bss_size; /* size of BSS */ 460 #endif461 459 } dtrace_objinfo_t; 462 460 … … 475 473 } dtrace_syminfo_t; 476 474 477 #ifndef VBOX478 475 extern int dtrace_lookup_by_name(dtrace_hdl_t *, const char *, const char *, 479 476 GElf_Sym *, dtrace_syminfo_t *); … … 481 478 extern int dtrace_lookup_by_addr(dtrace_hdl_t *, GElf_Addr addr, 482 479 GElf_Sym *, dtrace_syminfo_t *); 483 #endif /* !VBOX */484 480 485 481 typedef struct dtrace_typeinfo { … … 492 488 dtrace_typeinfo_t *); 493 489 494 #ifndef VBOX495 490 extern int dtrace_symbol_type(dtrace_hdl_t *, const GElf_Sym *, 496 491 const dtrace_syminfo_t *, dtrace_typeinfo_t *); 497 #endif498 492 499 493 extern int dtrace_type_strcompile(dtrace_hdl_t *, … … 535 529 struct dtrace_vector { 536 530 int (*dtv_ioctl)(void *, int, void *); 537 #ifndef VBOX538 531 int (*dtv_lookup_by_addr)(void *, GElf_Addr, GElf_Sym *, 539 532 dtrace_syminfo_t *); 540 #endif /* !VBOX */541 533 int (*dtv_status)(void *, processorid_t); 542 534 long (*dtv_sysconf)(void *, int);
Note:
See TracChangeset
for help on using the changeset viewer.