VirtualBox

Changeset 40860 in vbox


Ignore:
Timestamp:
Apr 10, 2012 11:46:03 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77393
Message:

VBoxTpG: another darwin fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/VBoxTpG.cpp

    r40857 r40860  
    726726     * Emit code for the stub functions.
    727727     */
     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");
    728731    ScmStreamPrintf(pStrm,
    729732                    "\n"
     
    735738                    g_fProbeFnImported ? "IMP" : "",
    736739                    g_pszProbeFnName);
     740    if (fMachO64 && g_fProbeFnImported)
     741        ScmStreamPrintf(pStrm,
     742                        "g_pfnVtgProbeFn:\n"
     743                        "   dq NAME(%s)\n",
     744                        g_pszProbeFnName);
     745
    737746    RTListForEach(&g_ProviderHead, pProvider, VTGPROVIDER, ListEntry)
    738747    {
     
    749758            ScmStreamPrintf(pStrm,
    750759                            ");\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");
    754760
    755761            /*
     
    770776                                "        jz      .return            ; jump on false\n");
    771777
    772 #if 0
    773             /*
    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 probe
    779                    function differs by taking all uint64_t arguments instead
    780                    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 a
    785                    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             else
    806                 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 #else
    815778            /*
    816779             * Jump to the fire-probe function.
     
    830793                                "        jmp     NAME(%s)\n"
    831794                                , g_pszProbeFnName);
     795            else if (fMachO64 && g_fProbeFnImported)
     796                ScmStreamPrintf(pStrm,
     797                                "        jmp     [g_pfnVtgProbeFn wrt rip]\n");
    832798            else
    833799                ScmStreamPrintf(pStrm, g_fProbeFnImported ?
     
    837803                                "        jmp     NAME(%s)\n"
    838804                                , g_pszProbeFnName);
    839 #endif
    840805
    841806            ScmStreamPrintf(pStrm,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette