Changeset 37573 in vbox for trunk/src/VBox
- Timestamp:
- Jun 21, 2011 11:40:11 AM (14 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/mach_kernel-r0drv-darwin.cpp
r37569 r37573 38 38 RT_C_DECLS_END 39 39 #endif 40 #include "../../include/internal/iprt.h" 40 41 #include "internal/iprt.h" 42 #include <iprt/darwin/machkernel.h> 41 43 42 44 #ifdef IN_RING0 /* till RTFILE is changed in types.h */ … … 57 59 #include <iprt/mem.h> 58 60 #include <iprt/string.h> 59 #include " ../../include/internal/ldrMach-O.h"61 #include "internal/ldrMach-O.h" 60 62 61 63 /** @def MY_CPU_TYPE … … 122 124 * and successfully resolving their addresses. 123 125 */ 124 typedef struct RTR0 DARWINKERNEL126 typedef struct RTR0MACHKERNELINT 125 127 { 126 128 /** @name Result. … … 162 164 /** Buffer space. */ 163 165 char abBuf[_4K]; 164 } RTR0DARWINKERNEL; 165 typedef RTR0DARWINKERNEL *PRTR0DARWINKERNEL; 166 } RTR0MACHKERNELINT; 166 167 167 168 … … 170 171 *******************************************************************************/ 171 172 #ifdef DEBUG 172 static bool g_fBreakpointOnError = true;173 static bool g_fBreakpointOnError = false; 173 174 #endif 174 175 … … 315 316 316 317 /** 317 * Frees up the internal scratch data when done looking up symbols.318 *319 * @param pKernel The internal scratch data.320 */321 static void rtR0DarwinMachKernelClose(PRTR0DARWINKERNEL pKernel)322 {323 RTMemFree(pKernel->pachStrTab);324 pKernel->pachStrTab = NULL;325 326 RTMemFree(pKernel->paSyms);327 pKernel->paSyms = NULL;328 329 RTMemFree(pKernel);330 }331 332 333 /**334 318 * Close and free up resources we no longer needs. 335 319 * 336 * @param p KernelThe internal scratch data.320 * @param pThis The internal scratch data. 337 321 */ 338 static void rtR0 DarwinMachKernelLoadDone(PRTR0DARWINKERNEL pKernel)339 { 340 RTFileClose(p Kernel->hFile);341 p Kernel->hFile = NIL_RTFILE;342 343 RTMemFree(p Kernel->pLoadCmds);344 p Kernel->pLoadCmds = NULL;345 memset((void *)&p Kernel->apSections[0], 0, sizeof(pKernel->apSections[0]) * MACHO_MAX_SECT);322 static void rtR0MachKernelLoadDone(RTR0MACHKERNELINT *pThis) 323 { 324 RTFileClose(pThis->hFile); 325 pThis->hFile = NIL_RTFILE; 326 327 RTMemFree(pThis->pLoadCmds); 328 pThis->pLoadCmds = NULL; 329 memset((void *)&pThis->apSections[0], 0, sizeof(pThis->apSections[0]) * MACHO_MAX_SECT); 346 330 } 347 331 … … 352 336 * 353 337 * @returns The symbol address on success, 0 on failure. 354 * @param p KernelThe internal scratch data.338 * @param pThis The internal scratch data. 355 339 * @param pszSymbol The symbol to resolve. Automatically prefixed 356 340 * with an underscore. 357 341 */ 358 static uintptr_t rtR0 DarwinMachKernelLookup(PRTR0DARWINKERNEL pKernel, const char *pszSymbol)359 { 360 uint32_t const cSyms = p Kernel->cSyms;361 MY_NLIST const *pSym = p Kernel->paSyms;342 static uintptr_t rtR0MachKernelLookup(RTR0MACHKERNELINT *pThis, const char *pszSymbol) 343 { 344 uint32_t const cSyms = pThis->cSyms; 345 MY_NLIST const *pSym = pThis->paSyms; 362 346 363 347 #if 1 … … 368 352 continue; 369 353 370 const char *pszTabName= &p Kernel->pachStrTab[(uint32_t)pSym->n_un.n_strx];354 const char *pszTabName= &pThis->pachStrTab[(uint32_t)pSym->n_un.n_strx]; 371 355 if ( *pszTabName == '_' 372 356 && strcmp(pszTabName + 1, pszSymbol) == 0) … … 398 382 * 399 383 * @returns IPRT status code. 400 * @param p KernelThe internal scratch data.384 * @param pThis The internal scratch data. 401 385 */ 402 static int rtR0 DarwinMachKernelCheckStandardSymbols(PRTR0DARWINKERNEL pKernel)386 static int rtR0MachKernelCheckStandardSymbols(RTR0MACHKERNELINT *pThis) 403 387 { 404 388 static struct … … 516 500 for (unsigned i = 0; i < RT_ELEMENTS(s_aStandardCandles); i++) 517 501 { 518 uintptr_t uAddr = rtR0 DarwinMachKernelLookup(pKernel, s_aStandardCandles[i].pszName);502 uintptr_t uAddr = rtR0MachKernelLookup(pThis, s_aStandardCandles[i].pszName); 519 503 #ifdef IN_RING0 520 504 if (uAddr != s_aStandardCandles[i].uAddr) … … 535 519 * 536 520 * @returns IPRT status code. 537 * @param p KernelThe internal scratch data.521 * @param pThis The internal scratch data. 538 522 */ 539 static int rtR0 DarwinMachKernelLoadSymTab(PRTR0DARWINKERNEL pKernel)523 static int rtR0MachKernelLoadSymTab(RTR0MACHKERNELINT *pThis) 540 524 { 541 525 /* 542 526 * Load the tables. 543 527 */ 544 p Kernel->paSyms = (MY_NLIST *)RTMemAllocZ(pKernel->cSyms * sizeof(MY_NLIST));545 if (!p Kernel->paSyms)528 pThis->paSyms = (MY_NLIST *)RTMemAllocZ(pThis->cSyms * sizeof(MY_NLIST)); 529 if (!pThis->paSyms) 546 530 return VERR_NO_MEMORY; 547 531 548 int rc = RTFileReadAt(p Kernel->hFile, pKernel->offArch + pKernel->offSyms,549 p Kernel->paSyms, pKernel->cSyms * sizeof(MY_NLIST), NULL);532 int rc = RTFileReadAt(pThis->hFile, pThis->offArch + pThis->offSyms, 533 pThis->paSyms, pThis->cSyms * sizeof(MY_NLIST), NULL); 550 534 if (RT_FAILURE(rc)) 551 535 return rc; 552 536 553 p Kernel->pachStrTab = (char *)RTMemAllocZ(pKernel->cbStrTab + 1);554 if (!p Kernel->pachStrTab)537 pThis->pachStrTab = (char *)RTMemAllocZ(pThis->cbStrTab + 1); 538 if (!pThis->pachStrTab) 555 539 return VERR_NO_MEMORY; 556 540 557 rc = RTFileReadAt(p Kernel->hFile, pKernel->offArch + pKernel->offStrTab,558 p Kernel->pachStrTab, pKernel->cbStrTab, NULL);541 rc = RTFileReadAt(pThis->hFile, pThis->offArch + pThis->offStrTab, 542 pThis->pachStrTab, pThis->cbStrTab, NULL); 559 543 if (RT_FAILURE(rc)) 560 544 return rc; … … 563 547 * The first string table symbol must be a zero length name. 564 548 */ 565 if (p Kernel->pachStrTab[0] != '\0')549 if (pThis->pachStrTab[0] != '\0') 566 550 RETURN_VERR_BAD_EXE_FORMAT; 567 551 … … 570 554 */ 571 555 const char *pszPrev = ""; 572 uint32_t const cSyms = p Kernel->cSyms;573 MY_NLIST const *pSym = p Kernel->paSyms;556 uint32_t const cSyms = pThis->cSyms; 557 MY_NLIST const *pSym = pThis->paSyms; 574 558 for (uint32_t iSym = 0; iSym < cSyms; iSym++, pSym++) 575 559 { 576 if ((uint32_t)pSym->n_un.n_strx >= p Kernel->cbStrTab)560 if ((uint32_t)pSym->n_un.n_strx >= pThis->cbStrTab) 577 561 RETURN_VERR_BAD_EXE_FORMAT; 578 const char *pszSym = &p Kernel->pachStrTab[(uint32_t)pSym->n_un.n_strx];562 const char *pszSym = &pThis->pachStrTab[(uint32_t)pSym->n_un.n_strx]; 579 563 #ifdef IN_RING3 580 564 RTAssertMsg2("%05i: %02x:%08x %02x %04x %s\n", iSym, pSym->n_sect, pSym->n_value, pSym->n_type, pSym->n_desc, pszSym); … … 591 575 if (pSym->n_sect == MACHO_NO_SECT) 592 576 RETURN_VERR_BAD_EXE_FORMAT; 593 if (pSym->n_sect > p Kernel->cSections)577 if (pSym->n_sect > pThis->cSections) 594 578 RETURN_VERR_BAD_EXE_FORMAT; 595 579 if (pSym->n_desc & ~(REFERENCED_DYNAMICALLY)) 596 580 RETURN_VERR_BAD_EXE_FORMAT; 597 if (pSym->n_value < p Kernel->apSections[pSym->n_sect - 1]->addr)598 RETURN_VERR_BAD_EXE_FORMAT; 599 if ( pSym->n_value - p Kernel->apSections[pSym->n_sect - 1]->addr600 > p Kernel->apSections[pSym->n_sect - 1]->size)581 if (pSym->n_value < pThis->apSections[pSym->n_sect - 1]->addr) 582 RETURN_VERR_BAD_EXE_FORMAT; 583 if ( pSym->n_value - pThis->apSections[pSym->n_sect - 1]->addr 584 > pThis->apSections[pSym->n_sect - 1]->size) 601 585 RETURN_VERR_BAD_EXE_FORMAT; 602 586 break; … … 606 590 if (pSym->n_sect != MACHO_NO_SECT) 607 591 #else 608 if (pSym->n_sect > p Kernel->cSections)592 if (pSym->n_sect > pThis->cSections) 609 593 #endif 610 594 RETURN_VERR_BAD_EXE_FORMAT; … … 640 624 * 641 625 * @returns IPRT status code. 642 * @param p KernelThe internal scratch data.626 * @param pThis The internal scratch data. 643 627 */ 644 static int rtR0 DarwinMachKernelLoadCommands(PRTR0DARWINKERNEL pKernel)645 { 646 p Kernel->offStrTab = 0;647 p Kernel->cbStrTab = 0;648 p Kernel->offSyms = 0;649 p Kernel->cSyms = 0;650 p Kernel->cSections = 0;651 652 p Kernel->pLoadCmds = (load_command_t *)RTMemAlloc(pKernel->cbLoadCmds);653 if (!p Kernel->pLoadCmds)628 static int rtR0MachKernelLoadCommands(RTR0MACHKERNELINT *pThis) 629 { 630 pThis->offStrTab = 0; 631 pThis->cbStrTab = 0; 632 pThis->offSyms = 0; 633 pThis->cSyms = 0; 634 pThis->cSections = 0; 635 636 pThis->pLoadCmds = (load_command_t *)RTMemAlloc(pThis->cbLoadCmds); 637 if (!pThis->pLoadCmds) 654 638 return VERR_NO_MEMORY; 655 639 656 int rc = RTFileReadAt(p Kernel->hFile, pKernel->offArch + sizeof(MY_MACHO_HEADER),657 p Kernel->pLoadCmds, pKernel->cbLoadCmds, NULL);640 int rc = RTFileReadAt(pThis->hFile, pThis->offArch + sizeof(MY_MACHO_HEADER), 641 pThis->pLoadCmds, pThis->cbLoadCmds, NULL); 658 642 if (RT_FAILURE(rc)) 659 643 return rc; … … 663 647 * table location. 664 648 */ 665 load_command_t const *pCmd = p Kernel->pLoadCmds;649 load_command_t const *pCmd = pThis->pLoadCmds; 666 650 for (uint32_t iCmd = 0; ; iCmd++) 667 651 { 668 652 /* cmd index & offset. */ 669 uintptr_t offCmd = (uintptr_t)pCmd - (uintptr_t)p Kernel->pLoadCmds;670 if (offCmd == p Kernel->cbLoadCmds && iCmd == pKernel->cLoadCmds)653 uintptr_t offCmd = (uintptr_t)pCmd - (uintptr_t)pThis->pLoadCmds; 654 if (offCmd == pThis->cbLoadCmds && iCmd == pThis->cLoadCmds) 671 655 break; 672 if (offCmd + sizeof(*pCmd) > p Kernel->cbLoadCmds)656 if (offCmd + sizeof(*pCmd) > pThis->cbLoadCmds) 673 657 RETURN_VERR_BAD_EXE_FORMAT; 674 if (iCmd >= p Kernel->cLoadCmds)658 if (iCmd >= pThis->cLoadCmds) 675 659 RETURN_VERR_BAD_EXE_FORMAT; 676 660 … … 678 662 if (pCmd->cmdsize < sizeof(*pCmd)) 679 663 RETURN_VERR_BAD_EXE_FORMAT; 680 if (pCmd->cmdsize > p Kernel->cbLoadCmds)664 if (pCmd->cmdsize > pThis->cbLoadCmds) 681 665 RETURN_VERR_BAD_EXE_FORMAT; 682 666 if (RT_ALIGN_32(pCmd->cmdsize, 4) != pCmd->cmdsize) … … 697 681 RETURN_VERR_BAD_EXE_FORMAT; 698 682 699 p Kernel->offStrTab = pSymTab->stroff;700 p Kernel->cbStrTab = pSymTab->strsize;701 p Kernel->offSyms = pSymTab->symoff;702 p Kernel->cSyms = pSymTab->nsyms;683 pThis->offStrTab = pSymTab->stroff; 684 pThis->cbStrTab = pSymTab->strsize; 685 pThis->offSyms = pSymTab->symoff; 686 pThis->cSyms = pSymTab->nsyms; 703 687 break; 704 688 } … … 796 780 797 781 /* Add to the section table. */ 798 if (p Kernel->cSections == MACHO_MAX_SECT)799 RETURN_VERR_BAD_EXE_FORMAT; 800 p Kernel->apSections[pKernel->cSections++] = &paSects[i];782 if (pThis->cSections == MACHO_MAX_SECT) 783 RETURN_VERR_BAD_EXE_FORMAT; 784 pThis->apSections[pThis->cSections++] = &paSects[i]; 801 785 } 802 786 … … 866 850 * 867 851 * @returns IPRT status code. 868 * @param p KernelThe internal scratch data.852 * @param pThis The internal scratch data. 869 853 */ 870 static int rtR0 DarwinMachKernelLoadFileHeaders(PRTR0DARWINKERNEL pKernel)854 static int rtR0MachKernelLoadFileHeaders(RTR0MACHKERNELINT *pThis) 871 855 { 872 856 uint32_t i; 873 857 874 p Kernel->offArch = 0;875 p Kernel->cbArch = 0;858 pThis->offArch = 0; 859 pThis->cbArch = 0; 876 860 877 861 /* 878 862 * Read the first bit of the file, parse the FAT if found there. 879 863 */ 880 int rc = RTFileReadAt(p Kernel->hFile, 0, pKernel->abBuf, sizeof(fat_header_t) + sizeof(fat_arch_t) * 16, NULL);864 int rc = RTFileReadAt(pThis->hFile, 0, pThis->abBuf, sizeof(fat_header_t) + sizeof(fat_arch_t) * 16, NULL); 881 865 if (RT_FAILURE(rc)) 882 866 return rc; 883 867 884 fat_header_t *pFat = (fat_header *)p Kernel->abBuf;868 fat_header_t *pFat = (fat_header *)pThis->abBuf; 885 869 fat_arch_t *paFatArches = (fat_arch_t *)(pFat + 1); 886 870 … … 912 896 && paFatArches[i].cpusubtype == MY_CPU_SUBTYPE_ALL) 913 897 { 914 p Kernel->offArch = paFatArches[i].offset;915 p Kernel->cbArch = paFatArches[i].size;916 if (!p Kernel->cbArch)917 RETURN_VERR_BAD_EXE_FORMAT; 918 if (p Kernel->offArch < sizeof(fat_header_t) + sizeof(fat_arch_t) * pFat->nfat_arch)919 RETURN_VERR_BAD_EXE_FORMAT; 920 if (p Kernel->offArch + pKernel->cbArch <= pKernel->offArch)898 pThis->offArch = paFatArches[i].offset; 899 pThis->cbArch = paFatArches[i].size; 900 if (!pThis->cbArch) 901 RETURN_VERR_BAD_EXE_FORMAT; 902 if (pThis->offArch < sizeof(fat_header_t) + sizeof(fat_arch_t) * pFat->nfat_arch) 903 RETURN_VERR_BAD_EXE_FORMAT; 904 if (pThis->offArch + pThis->cbArch <= pThis->offArch) 921 905 RETURN_VERR_LDR_ARCH_MISMATCH; 922 906 break; … … 930 914 * Read the Mach-O header and validate it. 931 915 */ 932 rc = RTFileReadAt(p Kernel->hFile, pKernel->offArch, pKernel->abBuf, sizeof(MY_MACHO_HEADER), NULL);916 rc = RTFileReadAt(pThis->hFile, pThis->offArch, pThis->abBuf, sizeof(MY_MACHO_HEADER), NULL); 933 917 if (RT_FAILURE(rc)) 934 918 return rc; 935 MY_MACHO_HEADER const *pHdr = (MY_MACHO_HEADER const *)p Kernel->abBuf;919 MY_MACHO_HEADER const *pHdr = (MY_MACHO_HEADER const *)pThis->abBuf; 936 920 if (pHdr->magic != MY_MACHO_MAGIC) 937 921 { … … 961 945 RETURN_VERR_LDR_UNEXPECTED; 962 946 963 p Kernel->cLoadCmds = pHdr->ncmds;964 p Kernel->cbLoadCmds = pHdr->sizeofcmds;947 pThis->cLoadCmds = pHdr->ncmds; 948 pThis->cbLoadCmds = pHdr->sizeofcmds; 965 949 return VINF_SUCCESS; 966 950 } 967 951 968 952 969 /** 970 * Opens symbol table of the mach_kernel. 971 * 972 * @returns IPRT status code. 973 * @param pszMachKernel The path to the mach_kernel image. 974 * @param ppHandle Where to return a handle on success. 975 * Call rtR0DarwinMachKernelClose on it 976 * when done. 977 */ 978 static int rtR0DarwinMachKernelOpen(const char *pszMachKernel, PRTR0DARWINKERNEL *ppHandle) 979 { 980 *ppHandle = NULL; 981 PRTR0DARWINKERNEL pKernel = (PRTR0DARWINKERNEL)RTMemAllocZ(sizeof(*pKernel)); 982 if (!pKernel) 953 RTDECL(int) RTR0MachKernelOpen(const char *pszMachKernel, PRTR0MACHKERNEL phKernel) 954 { 955 *phKernel = NIL_RTR0MACHKERNEL; 956 957 RTR0MACHKERNELINT *pThis = (RTR0MACHKERNELINT *)RTMemAllocZ(sizeof(*pThis)); 958 if (!pThis) 983 959 return VERR_NO_MEMORY; 984 p Kernel->hFile = NIL_RTFILE;985 986 int rc = RTFileOpen(&p Kernel->hFile, pszMachKernel, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);960 pThis->hFile = NIL_RTFILE; 961 962 int rc = RTFileOpen(&pThis->hFile, pszMachKernel, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE); 987 963 if (RT_SUCCESS(rc)) 988 rc = rtR0 DarwinMachKernelLoadFileHeaders(pKernel);964 rc = rtR0MachKernelLoadFileHeaders(pThis); 989 965 if (RT_SUCCESS(rc)) 990 rc = rtR0 DarwinMachKernelLoadCommands(pKernel);966 rc = rtR0MachKernelLoadCommands(pThis); 991 967 if (RT_SUCCESS(rc)) 992 rc = rtR0 DarwinMachKernelLoadSymTab(pKernel);968 rc = rtR0MachKernelLoadSymTab(pThis); 993 969 if (RT_SUCCESS(rc)) 994 rc = rtR0 DarwinMachKernelCheckStandardSymbols(pKernel);995 996 rtR0 DarwinMachKernelLoadDone(pKernel);970 rc = rtR0MachKernelCheckStandardSymbols(pThis); 971 972 rtR0MachKernelLoadDone(pThis); 997 973 if (RT_SUCCESS(rc)) 998 *p pHandle = pKernel;974 *phKernel = pThis; 999 975 else 1000 rtR0DarwinMachKernelClose(pKernel);976 RTR0MachKernelClose(pThis); 1001 977 return rc; 1002 978 } 1003 979 980 981 RTR0DECL(int) RTR0MachKernelGetSymbol(RTR0MACHKERNEL hKernel, const char *pszSymbol, void **ppvValue) 982 { 983 RTR0MACHKERNELINT *pThis = hKernel; 984 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 985 986 uintptr_t uValue = rtR0MachKernelLookup(pThis, pszSymbol); 987 if (ppvValue) 988 *ppvValue = (void *)uValue; 989 if (!uValue) 990 return VERR_SYMBOL_NOT_FOUND; 991 return VINF_SUCCESS; 992 } 993 994 995 RTR0DECL(int) RTR0MachKernelClose(RTR0MACHKERNEL hKernel) 996 { 997 if (hKernel == NIL_RTR0MACHKERNEL) 998 return VINF_SUCCESS; 999 1000 RTR0MACHKERNELINT *pThis = hKernel; 1001 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1002 1003 RTMemFree(pThis->pachStrTab); 1004 pThis->pachStrTab = NULL; 1005 1006 RTMemFree(pThis->paSyms); 1007 pThis->paSyms = NULL; 1008 1009 RTMemFree(pThis); 1010 return VINF_SUCCESS; 1011 } 1012 -
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r37560 r37573 578 578 579 579 tstRTDarwinMachKernel_TEMPLATE = VBOXR3TSTEXE 580 tstRTDarwinMachKernel_SOURCES = tstRTDarwinMachKernel.cpp 580 tstRTDarwinMachKernel_INCS = ../include 581 tstRTDarwinMachKernel_SOURCES = \ 582 tstRTDarwinMachKernel.cpp \ 583 ../r0drv/darwin/mach_kernel-r0drv-darwin.cpp 581 584 582 585 ntGetTimerResolution_SOURCES = ntGetTimerResolution.cpp -
trunk/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp
r37566 r37573 25 25 */ 26 26 27 27 28 /******************************************************************************* 28 29 * Header Files * 29 30 *******************************************************************************/ 31 #include <iprt/darwin/machkernel.h> 30 32 #include <iprt/err.h> 31 33 #include <iprt/string.h> 32 34 #include <iprt/test.h> 33 35 34 #include "../r0drv/darwin/mach_kernel-r0drv-darwin.cpp"35 36 36 37 37 38 static void dotest(const char *pszMachKernel) 38 39 { 39 PRTR0DARWINKERNEL pKernel;40 RTTESTI_CHECK_RC_RETV( rtR0DarwinMachKernelOpen(pszMachKernel, &pKernel), VINF_SUCCESS);40 RTR0MACHKERNEL hKernel; 41 RTTESTI_CHECK_RC_RETV(RTR0MachKernelOpen(pszMachKernel, &hKernel), VINF_SUCCESS); 41 42 static const char * const s_apszSyms[] = 42 43 { 43 44 "ast_pending", 44 "i386_signal_cpu", 45 "i386_cpu_IPI", 45 "cpu_interrupt", 46 46 "dtrace_register", 47 47 "dtrace_suspend", … … 49 49 for (unsigned i = 0; i < RT_ELEMENTS(s_apszSyms); i++) 50 50 { 51 uintptr_t uPtr = rtR0DarwinMachKernelLookup(pKernel, s_apszSyms[i]); 52 RTTestIPrintf(RTTESTLVL_ALWAYS, "%p %s\n", uPtr, s_apszSyms[i]); 53 RTTESTI_CHECK(uPtr != 0); 51 void *pvValue = NULL; 52 int rc = RTR0MachKernelGetSymbol(hKernel, s_apszSyms[i], &pvValue); 53 RTTestIPrintf(RTTESTLVL_ALWAYS, "%Rrc %p %s\n", rc, pvValue, s_apszSyms[i]); 54 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 55 if (RT_SUCCESS(rc)) 56 RTTESTI_CHECK_RC(RTR0MachKernelGetSymbol(hKernel, s_apszSyms[i], NULL), VINF_SUCCESS); 54 57 } 55 rtR0DarwinMachKernelClose(pKernel); 58 59 RTTESTI_CHECK_RC(RTR0MachKernelGetSymbol(hKernel, "no_such_symbol_name_really", NULL), VERR_SYMBOL_NOT_FOUND); 60 RTTESTI_CHECK_RC(RTR0MachKernelClose(hKernel), VINF_SUCCESS); 61 RTTESTI_CHECK_RC(RTR0MachKernelClose(NIL_RTR0MACHKERNEL), VINF_SUCCESS); 56 62 } 57 63 … … 60 66 { 61 67 RTTEST hTest; 62 RTEXITCODE rcExit = RTTestInitAndCreate("tstRT DarwinMachKernel", &hTest);68 RTEXITCODE rcExit = RTTestInitAndCreate("tstRTMachKernel", &hTest); 63 69 if (rcExit != RTEXITCODE_SUCCESS) 64 70 return rcExit;
Note:
See TracChangeset
for help on using the changeset viewer.