Index: /trunk/include/VBox/vmm/dbgfcorefmt.h
===================================================================
--- /trunk/include/VBox/vmm/dbgfcorefmt.h	(revision 56513)
+++ /trunk/include/VBox/vmm/dbgfcorefmt.h	(revision 56514)
@@ -48,5 +48,95 @@
 #define DBGFCORE_MAGIC          UINT32_C(0xc01ac0de)
 /** DBGCORECOREDESCRIPTOR::u32FmtVersion. */
-#define DBGFCORE_FMT_VERSION    UINT32_C(0x00010001)
+#define DBGFCORE_FMT_VERSION    UINT32_C(0x00010002)
+
+/**
+ * An x86 segment selector.
+ */
+typedef struct DBGFCORESEL
+{
+    uint64_t        uBase;
+    uint32_t        uLimit;
+    uint32_t        uAttr;
+    uint16_t        uSel;
+    uint16_t        uReserved;
+} VBOXX86SEL;
+AssertCompileSizeAlignment(DBGFCORESEL, 8);
+
+/**
+ * A gdtr/ldtr descriptor.
+ */
+typedef struct DBGFCOREXDTR
+{
+    uint64_t        uAddr;
+    uint32_t        cb;
+    uint32_t        uReserved0;
+} DBGFXDTR;
+AssertCompileSizeAlignment(DBGFCORESEL, 8);
+
+/**
+ * A simpler to parse CPU dump than CPUMCTX.
+ *
+ * Please bump DBGFCORE_FMT_VERSION by 1 if you make any changes to this
+ * structure.
+ */
+typedef struct DBGFCORECPU
+{
+    uint64_t            rax;
+    uint64_t            rbx;
+    uint64_t            rcx;
+    uint64_t            rdx;
+    uint64_t            rsi;
+    uint64_t            rdi;
+    uint64_t            r8;
+    uint64_t            r9;
+    uint64_t            r10;
+    uint64_t            r11;
+    uint64_t            r12;
+    uint64_t            r13;
+    uint64_t            r14;
+    uint64_t            r15;
+    uint64_t            rip;
+    uint64_t            rsp;
+    uint64_t            rbp;
+    DBGFCORESEL         cs;
+    DBGFCORESEL         ds;
+    DBGFCORESEL         es;
+    DBGFCORESEL         fs;
+    DBGFCORESEL         gs;
+    DBGFCORESEL         ss;
+    uint64_t            cr0;
+    uint64_t            cr2;
+    uint64_t            cr3;
+    uint64_t            cr4;
+    uint64_t            dr[8];
+    DBGFCOREXDTR        gdtr;
+    DBGFCOREXDTR        idtr;
+    VBOXX86SEL          ldtr;
+    VBOXX86SEL          tr;
+    union
+    {
+        uint64_t        cs;
+        uint64_t        eip;
+        uint64_t        esp;
+    } sysenter;
+    uint64_t            msrEFER;
+    uint64_t            msrSTAR;
+    uint64_t            msrPAT;
+    uint64_t            msrLSTAR;
+    uint64_t            msrCSTAR;
+    uint64_t            msrSFMASK;
+    uint64_t            msrKernelGSBase;
+    uint64_t            msrApicBase;
+    uint64_t            aXcr[2];
+    X86XSAVEAREA        ext;
+} DBGFCORECPU;
+/** Pointer to a DBGF-core CPU. */
+typedef DBGFCORECPU *PDBGFCORECPU;
+/** Pointer to the const DBGF-core CPU. */
+typedef const DBGFCORECPU *PCDBGFCORECPU;
+AssertCompileMemberAlignment(DBGFCORECPU, cr0,     8);
+AssertCompileMemberAlignment(DBGFCORECPU, msrEFER, 8);
+AssertCompileMemberAlignment(DBGFCORECPU, ext,     8);
+AssertCompileSizeAlignment(DBGFCORECPU, 8);
 
 /**
Index: /trunk/include/iprt/x86.h
===================================================================
--- /trunk/include/iprt/x86.h	(revision 56513)
+++ /trunk/include/iprt/x86.h	(revision 56514)
@@ -2744,5 +2744,10 @@
 
 
-
+/**
+ * x86 FPU/SSE/AVX/XXXX state.
+ *
+ * Please bump DBGFCORE_FMT_VERSION by 1 in dbgfcorefmt.h if you make any
+ * changes to this structure.
+ */
 typedef struct X86XSAVEAREA
 {
Index: /trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp	(revision 56513)
+++ /trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp	(revision 56514)
@@ -51,4 +51,5 @@
 #include <iprt/param.h>
 #include <iprt/file.h>
+#include <iprt/mem.h>
 
 #include "DBGFInternal.h"
@@ -310,4 +311,76 @@
 
 /**
+ * Gets the guest-CPU context suitable for dumping into the core file.
+ *
+ * @param   pCtx        Pointer to the guest-CPU context.
+ * @param   pDbgfCpu    Where to dump the guest-CPU data.
+ */
+static void dbgfR3GetCoreCpu(PCPUMCTX pCtx, PDBGFCORECPU pDbgfCpu)
+{
+#define DBGFCOPYSEL(a_dbgfsel, a_cpumselreg) \
+    do { \
+        (a_dbgfsel).uBase  = (a_cpumselreg).u64Base; \
+        (a_dbgfsel).uLimit = (a_cpumselreg).u32Limit; \
+        (a_dbgfsel).uAttr  = (a_cpumselreg).Attr.u; \
+        (a_dbgfsel).uSel   = (a_cpumselreg).Sel; \
+    } while (0)
+
+    pDbgfCpu->rax             = pCtx->rax;
+    pDbgfCpu->rbx             = pCtx->rbx;
+    pDbgfCpu->rcx             = pCtx->rcx;
+    pDbgfCpu->rdx             = pCtx->rdx;
+    pDbgfCpu->rsi             = pCtx->rsi;
+    pDbgfCpu->rdi             = pCtx->rdi;
+    pDbgfCpu->r8              = pCtx->r8;
+    pDbgfCpu->r9              = pCtx->r9;
+    pDbgfCpu->r10             = pCtx->r10;
+    pDbgfCpu->r11             = pCtx->r11;
+    pDbgfCpu->r12             = pCtx->r12;
+    pDbgfCpu->r13             = pCtx->r13;
+    pDbgfCpu->r14             = pCtx->r14;
+    pDbgfCpu->r15             = pCtx->r15;
+    pDbgfCpu->rip             = pCtx->rip;
+    pDbgfCpu->rsp             = pCtx->rsp;
+    pDbgfCpu->rbp             = pCtx->rbp;
+    DBGFCOPYSEL(pDbgfCpu->cs, pCtx->cs);
+    DBGFCOPYSEL(pDbgfCpu->ds, pCtx->ds);
+    DBGFCOPYSEL(pDbgfCpu->es, pCtx->es);
+    DBGFCOPYSEL(pDbgfCpu->fs, pCtx->fs);
+    DBGFCOPYSEL(pDbgfCpu->gs, pCtx->gs);
+    DBGFCOPYSEL(pDbgfCpu->ss, pCtx->ss);
+    pDbgfCpu->cr0             = pCtx->cr0;
+    pDbgfCpu->cr2             = pCtx->cr2;
+    pDbgfCpu->cr3             = pCtx->cr3;
+    pDbgfCpu->cr4             = pCtx->cr4;
+    AssertCompile(RT_ELEMENTS(pDbgfCpu->dr) == RT_ELEMENTS(pCtx->dr));
+    for (unsigned i = 0; i < RT_ELEMENTS(pDbgfCpu->dr); i++)
+        pDbgfCpu->dr[i] = pCtx->dr[i];
+    pDbgfCpu->gdtr.uAddr      = pCtx->gdtr.pGdt;
+    pDbgfCpu->gdtr.cb         = pCtx->gdtr.cbGdt;
+    pDbgfCpu->idtr.uAddr      = pCtx->idtr.pIdt;
+    pDbgfCpu->idtr.cb         = pCtx->idtr.cbIdt;
+    DBGFCOPYSEL(pDbgfCpu->ldtr, pCtx->ldtr);
+    DBGFCOPYSEL(pDbgfCpu->tr,   pCtx->tr);
+    pDbgfCpu->sysenter.cs     = pCtx->SysEnter.cs;
+    pDbgfCpu->sysenter.eip    = pCtx->SysEnter.eip;
+    pDbgfCpu->sysenter.esp    = pCtx->SysEnter.esp;
+    pDbgfCpu->msrEFER         = pCtx->msrEFER;
+    pDbgfCpu->msrSTAR         = pCtx->msrSTAR;
+    pDbgfCpu->msrPAT          = pCtx->msrPAT;
+    pDbgfCpu->msrLSTAR        = pCtx->msrLSTAR;
+    pDbgfCpu->msrCSTAR        = pCtx->msrCSTAR;
+    pDbgfCpu->msrSFMASK       = pCtx->msrSFMASK;
+    pDbgfCpu->msrKernelGSBase = pCtx->msrKERNELGSBASE;
+    pDbgfCpu->msrApicBase     = pCtx->msrApicBase;
+    pDbgfCpu->aXcr[0]         = pCtx->aXcr[0];
+    pDbgfCpu->aXcr[1]         = pCtx->aXcr[1];
+    AssertCompile(sizeof(pDbgfCpu->ext) == sizeof(*pCtx->pXStateR3));
+    memcpy(&pDbgfCpu->ext, pCtx->pXStateR3, sizeof(pDbgfCpu->ext));
+
+#undef DBGFCOPYSEL
+}
+
+
+/**
  * Worker function for dbgfR3CoreWrite() which does the writing.
  *
@@ -346,5 +419,5 @@
     uint64_t const cbCoreDescriptor   = Elf64NoteSectionSize(g_pcszCoreVBoxCore, sizeof(CoreDescriptor));
     uint64_t const offCpuDumps        = offCoreDescriptor + cbCoreDescriptor;
-    uint64_t const cbCpuDumps         = pVM->cCpus * Elf64NoteSectionSize(g_pcszCoreVBoxCpu, sizeof(CPUMCTX));
+    uint64_t const cbCpuDumps         = pVM->cCpus * Elf64NoteSectionSize(g_pcszCoreVBoxCpu, sizeof(DBGFCORECPU));
     uint64_t const offMemory          = offCpuDumps       + cbCpuDumps;
 
@@ -429,17 +502,35 @@
      * Write the CPU context note headers and data.
      */
-    /** @todo r=ramshankar: Dump a more standardized CPU structure rather than
-     *        dumping CPUMCTX and bump the core file version number. */
     Assert(RTFileTell(hFile) == offCpuDumps);
+    PDBGFCORECPU pDbgfCoreCpu = (PDBGFCORECPU)RTMemAlloc(sizeof(*pDbgfCoreCpu));
+    if (RT_UNLIKELY(!pDbgfCoreCpu))
+    {
+        LogRel((DBGFLOG_NAME ": failed to alloc %u bytes for DBGFCORECPU\n", sizeof(*pDbgfCoreCpu)));
+        return VERR_NO_MEMORY;
+    }
+
     for (uint32_t iCpu = 0; iCpu < pVM->cCpus; iCpu++)
     {
-        PCPUMCTX pCpuCtx = CPUMQueryGuestCtxPtr(&pVM->aCpus[iCpu]);
-        rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, g_pcszCoreVBoxCpu, pCpuCtx, sizeof(CPUMCTX));
+        PVMCPU      pVCpu = &pVM->aCpus[iCpu];
+        PCPUMCTX    pCtx  = CPUMQueryGuestCtxPtr(pVCpu);
+        if (RT_UNLIKELY(!pCtx))
+        {
+            LogRel((DBGFLOG_NAME ": CPUMQueryGuestCtxPtr failed for vCPU[%u]\n", iCpu));
+            RTMemFree(pDbgfCoreCpu);
+            return VERR_INVALID_POINTER;
+        }
+
+        RT_BZERO(pDbgfCoreCpu, sizeof(*pDbgfCoreCpu));
+        dbgfR3GetCoreCpu(pCtx, pDbgfCoreCpu);
+        rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, g_pcszCoreVBoxCpu, pDbgfCoreCpu, sizeof(*pDbgfCoreCpu));
         if (RT_FAILURE(rc))
         {
             LogRel((DBGFLOG_NAME ": Elf64WriteNoteHdr failed for vCPU[%u] rc=%Rrc\n", iCpu, rc));
+            RTMemFree(pDbgfCoreCpu);
             return rc;
         }
     }
+    RTMemFree(pDbgfCoreCpu);
+    pDbgfCoreCpu = NULL;
 
     /*
