Changeset 40860 in vbox
- Timestamp:
- Apr 10, 2012 11:46:03 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77393
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/VBoxTpG.cpp
r40857 r40860 726 726 * Emit code for the stub functions. 727 727 */ 728 bool const fWin64 = g_cBits == 64 && (!strcmp(g_pszAssemblerFmtVal, "win64") || !strcmp(g_pszAssemblerFmtVal, "pe64")); 729 bool const fMachO64 = g_cBits == 64 && !strcmp(g_pszAssemblerFmtVal, "macho64"); 730 bool const fMachO32 = g_cBits == 32 && !strcmp(g_pszAssemblerFmtVal, "macho32"); 728 731 ScmStreamPrintf(pStrm, 729 732 "\n" … … 735 738 g_fProbeFnImported ? "IMP" : "", 736 739 g_pszProbeFnName); 740 if (fMachO64 && g_fProbeFnImported) 741 ScmStreamPrintf(pStrm, 742 "g_pfnVtgProbeFn:\n" 743 " dq NAME(%s)\n", 744 g_pszProbeFnName); 745 737 746 RTListForEach(&g_ProviderHead, pProvider, VTGPROVIDER, ListEntry) 738 747 { … … 749 758 ScmStreamPrintf(pStrm, 750 759 ");\n"); 751 752 bool const fWin64 = g_cBits == 64 && (!strcmp(g_pszAssemblerFmtVal, "win64") || !strcmp(g_pszAssemblerFmtVal, "pe64"));753 bool const fMachO32 = g_cBits == 32 && !strcmp(g_pszAssemblerFmtVal, "macho32");754 760 755 761 /* … … 770 776 " jz .return ; jump on false\n"); 771 777 772 #if 0773 /*774 * Shuffle the arguments around, replacing the location pointer with the probe ID.775 */776 if (fMachO32)777 {778 /* Need to recreate the stack frame entirely here as the probe779 function differs by taking all uint64_t arguments instead780 of uintptr_t. Understandable, but real PITA. */781 ScmStreamPrintf(pStrm, "int3\n");782 }783 else if (g_cBits == 32)784 /* Assumes the size of the arguments are no larger than a785 pointer. This is asserted in the header. */786 ScmStreamPrintf(pStrm, g_fProbeFnImported ?787 " mov edx, [eax + 4] ; idProbe\n"788 " mov ecx, IMP2(%s)\n"789 " mov [esp + 4], edx ; Replace pVTGProbeLoc with idProbe.\n"790 " jmp ecx\n"791 :792 " mov edx, [eax + 4] ; idProbe\n"793 " mov [esp + 4], edx ; Replace pVTGProbeLoc with idProbe.\n"794 " jmp NAME(%s)\n"795 , g_pszProbeFnName);796 else if (fWin64)797 ScmStreamPrintf(pStrm, g_fProbeFnImported ?798 " mov rax, IMP2(%s)\n"799 " mov ecx, [rcx + 4] ; idProbe replaces pVTGProbeLoc.\n"800 " jmp rax\n"801 :802 " mov ecx, [rcx + 4] ; idProbe replaces pVTGProbeLoc.\n"803 " jmp NAME(%s)\n"804 , g_pszProbeFnName);805 else806 ScmStreamPrintf(pStrm, g_fProbeFnImported ?807 " lea rax, [IMP2(%s)]\n" //??? macho64?808 " mov edi, [rdi + 4] ; idProbe replaces pVTGProbeLoc.\n"809 " jmp rax\n"810 :811 " mov edi, [rdi + 4] ; idProbe replaces pVTGProbeLoc.\n"812 " jmp NAME(%s)\n"813 , g_pszProbeFnName);814 #else815 778 /* 816 779 * Jump to the fire-probe function. … … 830 793 " jmp NAME(%s)\n" 831 794 , g_pszProbeFnName); 795 else if (fMachO64 && g_fProbeFnImported) 796 ScmStreamPrintf(pStrm, 797 " jmp [g_pfnVtgProbeFn wrt rip]\n"); 832 798 else 833 799 ScmStreamPrintf(pStrm, g_fProbeFnImported ? … … 837 803 " jmp NAME(%s)\n" 838 804 , g_pszProbeFnName); 839 #endif840 805 841 806 ScmStreamPrintf(pStrm,
Note:
See TracChangeset
for help on using the changeset viewer.