VirtualBox

Changeset 83084 in vbox for trunk/src/VBox/Debugger


Ignore:
Timestamp:
Feb 15, 2020 3:16:11 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136139
Message:

IPRT,DBGPlugInDarwin: Added flags for indicating that the LINKEDIT segment should be loaded in Mach-O images and debug files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGPlugInDarwin.cpp

    r83083 r83084  
    548548     * Process the load commands.
    549549     */
     550    RTUUID          Uuid   = RTUUID_INITIALIZE_NULL;
    550551    RTDBGSEGMENT    aSegs[24];
    551552    uint32_t        cSegs  = 0;
    552     RTUUID          Uuid   = RTUUID_INITIALIZE_NULL;
     553    bool            fHasLinkEdit = false;
    553554    uint32_t        cLeft  = uBuf.Hdr32.ncmds;
    554555    uint32_t        cbLeft = uBuf.Hdr32.sizeofcmds;
     
    559560        segment_command_32_t const *pSeg32;
    560561        segment_command_64_t const *pSeg64;
    561         section_32_t const         *pSect32;
    562         section_64_t const         *pSect64;
    563         symtab_command_t const     *pSymTab;
    564562        uuid_command_t const       *pUuid;
    565563    } uLCmd;
     
    580578                    return VERR_INVALID_NAME;
    581579                if (   !strcmp(uLCmd.pSeg32->segname, "__LINKEDIT")
    582                     && !dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg32->vmaddr, uLCmd.pSeg32->vmsize,
    583                                                         uModAddr, uModAddr + _64M))
     580                    && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg32->vmaddr, uLCmd.pSeg32->vmsize,
     581                                                                        uModAddr, uModAddr + _64M)))
    584582                    break; /* This usually is discarded or not loaded at all. */
    585583                if (cSegs >= RT_ELEMENTS(aSegs))
     
    601599                    return VERR_INVALID_NAME;
    602600                if (   !strcmp(uLCmd.pSeg64->segname, "__LINKEDIT")
    603                     && !dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg64->vmaddr, uLCmd.pSeg64->vmsize,
    604                                                         uModAddr, uModAddr + _128M))
     601                    && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg64->vmaddr, uLCmd.pSeg64->vmsize,
     602                                                                        uModAddr, uModAddr + _128M)))
    605603                    break; /* This usually is discarded or not loaded at all. */
    606604                if (cSegs >= RT_ELEMENTS(aSegs))
     
    637635
    638636    if (cbLeft != 0)
     637    {
     638        LogRel(("OSXDig: uModAddr=%#RX64 - %u bytes of command left over!\n", uModAddr, cbLeft));
    639639        return VERR_BAD_EXE_FORMAT;
     640    }
    640641
    641642    /*
     
    657658    RTDBGMOD hMod;
    658659    rc = RTDbgModCreateFromMachOImage(&hMod, pszName, NULL, f64Bit ? RTLDRARCH_AMD64 : RTLDRARCH_X86_32, 0 /*cbImage*/,
    659                                       cSegs, aSegs, &Uuid, DBGFR3AsGetConfig(pUVM), RTDBGMOD_F_NOT_DEFERRED);
     660                                      cSegs, aSegs, &Uuid, DBGFR3AsGetConfig(pUVM),
     661                                      RTDBGMOD_F_NOT_DEFERRED | (fHasLinkEdit ? RTDBGMOD_F_MACHO_LOAD_LINKEDIT : 0));
    660662
    661663    if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

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