VirtualBox

Changeset 57167 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 4, 2015 9:52:02 AM (10 years ago)
Author:
vboxsync
Message:

VMM: Fix crash while dumping guest core.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp

    r56514 r57167  
    313313 * Gets the guest-CPU context suitable for dumping into the core file.
    314314 *
     315 * @param   pVM         Pointer to the VM.
    315316 * @param   pCtx        Pointer to the guest-CPU context.
    316317 * @param   pDbgfCpu    Where to dump the guest-CPU data.
    317318 */
    318 static void dbgfR3GetCoreCpu(PCPUMCTX pCtx, PDBGFCORECPU pDbgfCpu)
     319static void dbgfR3GetCoreCpu(PVM pVM, PCPUMCTX pCtx, PDBGFCORECPU pDbgfCpu)
    319320{
    320321#define DBGFCOPYSEL(a_dbgfsel, a_cpumselreg) \
     
    376377    pDbgfCpu->aXcr[1]         = pCtx->aXcr[1];
    377378    AssertCompile(sizeof(pDbgfCpu->ext) == sizeof(*pCtx->pXStateR3));
    378     memcpy(&pDbgfCpu->ext, pCtx->pXStateR3, sizeof(pDbgfCpu->ext));
     379    pDbgfCpu->cbExt = CPUMR3GetGuestFpuExtStateSize(pVM);
     380    if (RT_LIKELY(pDbgfCpu->cbExt))
     381        memcpy(&pDbgfCpu->ext, pCtx->pXStateR3, cbExt);
    379382
    380383#undef DBGFCOPYSEL
     
    522525
    523526        RT_BZERO(pDbgfCoreCpu, sizeof(*pDbgfCoreCpu));
    524         dbgfR3GetCoreCpu(pCtx, pDbgfCoreCpu);
     527        dbgfR3GetCoreCpu(pVM, pCtx, pDbgfCoreCpu);
    525528        rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, g_pcszCoreVBoxCpu, pDbgfCoreCpu, sizeof(*pDbgfCoreCpu));
    526529        if (RT_FAILURE(rc))
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