VirtualBox

Changeset 73471 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 3, 2018 12:11:07 PM (6 years ago)
Author:
vboxsync
Message:

VMM,DBGF: Improved unwinding of ring-0 assertion stacks, making the new unwind info stuff deal correctly with ring-0 pointers and such. bugref:3897

Location:
trunk/src/VBox/VMM
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm

    r71222 r73471  
    1919;* Header Files                                                                *
    2020;*******************************************************************************
     21%define RT_ASM_WITH_SEH64
    2122%include "VBox/asmdefs.mac"
    2223%include "VMMInternal.mac"
     
    6263    ;
    6364    push    rbp
     65    SEH64_PUSH_xBP
    6466    mov     rbp, rsp
     67    SEH64_SET_FRAME_xBP 0
    6568 %ifdef ASM_CALL64_MSC
    6669    sub     rsp, 30h + STACK_FUZZ_SIZE  ; (10h is used by resume (??), 20h for callee spill area)
     70    SEH64_ALLOCATE_STACK 30h + STACK_FUZZ_SIZE
     71SEH64_END_PROLOGUE
    6772    mov     r11, rdx                    ; pfn
    6873    mov     rdx, rcx                    ; pJmpBuf;
    6974 %else
    7075    sub     rsp, 10h + STACK_FUZZ_SIZE  ; (10h is used by resume (??))
     76    SEH64_ALLOCATE_STACK 10h + STACK_FUZZ_SIZE
     77SEH64_END_PROLOGUE
    7178    mov     r8, rdx                     ; pvUser1 (save it like MSC)
    7279    mov     r9, rcx                     ; pvUser2 (save it like MSC)
     
    302309    ;
    303310    push    rbp
     311    SEH64_PUSH_xBP
    304312    mov     rbp, rsp
     313    SEH64_SET_FRAME_xBP 0
    305314    push    r15
     315    SEH64_PUSH_GREG r15
    306316    push    r14
     317    SEH64_PUSH_GREG r14
    307318    push    r13
     319    SEH64_PUSH_GREG r13
    308320    push    r12
     321    SEH64_PUSH_GREG r12
    309322%ifdef ASM_CALL64_MSC
    310323    push    rdi
     324    SEH64_PUSH_GREG rdi
    311325    push    rsi
     326    SEH64_PUSH_GREG rsi
    312327%endif
    313328    push    rbx
     329    SEH64_PUSH_GREG rbx
    314330    pushf
     331    SEH64_ALLOCATE_STACK 8
    315332%ifdef RT_OS_WINDOWS
    316333    sub     rsp, 0a0h
     334    SEH64_ALLOCATE_STACK 0a0h
    317335    movdqa  [rsp + 000h], xmm6
    318336    movdqa  [rsp + 010h], xmm7
     
    328346%ifdef VBOX_STRICT
    329347    push    RESUME_MAGIC
    330 %endif
     348    SEH64_ALLOCATE_STACK 8
     349%endif
     350SEH64_END_PROLOGUE
    331351
    332352    ;
     
    373393
    374394 %endif ; !VMM_R0_SWITCH_STACK
     395
     396    ; Save a PC and return PC here to assist unwinding.
     397.unwind_point:
     398    lea     rcx, [.unwind_point wrt RIP]
     399    mov     [xDX + VMMR0JMPBUF.SavedEipForUnwind], rcx
     400    mov     rcx, [xDX + VMMR0JMPBUF.rbp]
     401    lea     rcx, [rcx + 8]
     402    mov     [xDX + VMMR0JMPBUF.UnwindRetPcLocation], rcx
     403    mov     rcx, [rcx]
     404    mov     [xDX + VMMR0JMPBUF.UnwindRetPcValue], rcx
    375405
    376406    ; Save RSP & RBP to enable stack dumps
     
    452482; @cproto VMMR0DECL(void) vmmR0LoggerWrapper(const char *pszFormat, ...)
    453483;
    454 EXPORTEDNAME vmmR0LoggerWrapper
     484BEGINPROC_EXPORTED vmmR0LoggerWrapper
     485SEH64_END_PROLOGUE
    455486    int3
    456487    int3
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm

    r71222 r73471  
    334334%endif ; !VMM_R0_SWITCH_STACK
    335335
     336    ; Save a PC here to assist unwinding.
     337.unwind_point:
     338    mov     dword [xDX + VMMR0JMPBUF.SavedEipForUnwind], .unwind_point
     339    mov     ecx, [xDX + VMMR0JMPBUF.ebp]
     340    lea     ecx, [ecx + 4]
     341    mov     [xDX + VMMR0JMPBUF.UnwindRetPcLocation], ecx
     342
    336343    ; Save ESP & EBP to enable stack dumps
    337344    mov     ecx, ebp
     
    353360    mov     ebp, [xDX + VMMR0JMPBUF.ebp]
    354361    mov     ecx, [xDX + VMMR0JMPBUF.eip]
     362    mov     [xDX + VMMR0JMPBUF.UnwindRetPcValue], ecx
    355363    mov     esp, [xDX + VMMR0JMPBUF.esp]
    356364    push    dword [xDX + VMMR0JMPBUF.eflags]
  • trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp

    r70948 r73471  
    205205    pAddress->FlatPtr = PhysAddr;
    206206    pAddress->fFlags  = DBGFADDRESS_FLAGS_PHYS | DBGFADDRESS_FLAGS_VALID;
     207    return pAddress;
     208}
     209
     210
     211/**
     212 * Creates a mixed address from a flat host ring-0 address.
     213 *
     214 * @returns pAddress
     215 * @param   pAddress        Where to store the mixed address.
     216 * @param   R0Ptr           The host ring-0 address.
     217 */
     218VMMR3_INT_DECL(PDBGFADDRESS) DBGFR3AddrFromHostR0(PDBGFADDRESS pAddress, RTR0UINTPTR R0Ptr)
     219{
     220    pAddress->FlatPtr = R0Ptr;
     221    pAddress->off     = R0Ptr;
     222    pAddress->fFlags  = DBGFADDRESS_FLAGS_RING0 | DBGFADDRESS_FLAGS_VALID;
     223    pAddress->Sel     = DBGF_SEL_FLAT;
    207224    return pAddress;
    208225}
  • trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp

    r73460 r73471  
    5555    RTDBGAS     m_hAs;
    5656    PCCPUMCTX   m_pInitialCtx;
     57    bool        m_fIsHostRing0;
    5758    uint64_t    m_uOsScratch; /**< For passing to DBGFOSREG::pfnStackUnwindAssist. */
    5859
     
    105106            m_State.u.x86.fRealOrV86           = CPUMIsGuestInRealOrV86ModeEx(pInitialCtx);
    106107        }
     108        else if (hAs == DBGF_AS_R0)
     109            VMMR3InitR0StackUnwindState(pUVM, idCpu, &m_State);
    107110
    108111        m_pUVM            = pUVM;
     
    110113        m_hAs             = DBGFR3AsResolveAndRetain(pUVM, hAs);
    111114        m_pInitialCtx     = pInitialCtx;
     115        m_fIsHostRing0    = hAs == DBGF_AS_R0;
    112116        m_uOsScratch      = 0;
    113117
     
    168172    DBGFADDRESS SrcAddr;
    169173    int rc = VINF_SUCCESS;
    170     if (   pThis->enmArch == RTLDRARCH_X86_32
    171         || pThis->enmArch == RTLDRARCH_X86_16)
    172     {
    173         if (!pThis->u.x86.fRealOrV86)
    174             rc = DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &SrcAddr, pThis->u.x86.auSegs[X86_SREG_SS], uSp);
     174    if (pUnwindCtx->m_fIsHostRing0)
     175        DBGFR3AddrFromHostR0(&SrcAddr, uSp);
     176    else
     177    {
     178        if (   pThis->enmArch == RTLDRARCH_X86_32
     179            || pThis->enmArch == RTLDRARCH_X86_16)
     180        {
     181            if (!pThis->u.x86.fRealOrV86)
     182                rc = DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &SrcAddr, pThis->u.x86.auSegs[X86_SREG_SS], uSp);
     183            else
     184                DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &SrcAddr, uSp + ((uint32_t)pThis->u.x86.auSegs[X86_SREG_SS] << 4));
     185        }
    175186        else
    176             DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &SrcAddr, uSp + ((uint32_t)pThis->u.x86.auSegs[X86_SREG_SS] << 4));
    177     }
    178     else
    179         DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &SrcAddr, uSp);
     187            DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &SrcAddr, uSp);
     188    }
    180189    if (RT_SUCCESS(rc))
    181190        rc = DBGFR3MemRead(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &SrcAddr, pvDst, cbToRead);
     
    449458                    {
    450459                        case IMAGE_AMD64_UWOP_PUSH_NONVOL:
    451                             pThis->u.x86.auRegs[X86_GREG_xSP] += 8;
    452460                            dbgUnwindLoadStackU64(pThis, pThis->u.x86.auRegs[X86_GREG_xSP], &pThis->u.x86.auRegs[uOpInfo]);
    453461                            pThis->u.x86.Loaded.s.fRegs |= RT_BIT(uOpInfo);
     462                            pThis->u.x86.auRegs[X86_GREG_xSP] += 8;
    454463                            iOpcode++;
    455464                            break;
     
    11691178        if (dbgfR3UnwindCtxDoOneFrame(pUnwindCtx))
    11701179        {
    1171             DBGFADDRESS AddrReturnFrame = pFrame->AddrReturnFrame;
    1172             rc = DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &AddrReturnFrame,
    1173                                       pUnwindCtx->m_State.u.x86.FrameAddr.sel, pUnwindCtx->m_State.u.x86.FrameAddr.off);
    1174             if (RT_SUCCESS(rc))
    1175                 pFrame->AddrReturnFrame      = AddrReturnFrame;
     1180            if (pUnwindCtx->m_fIsHostRing0)
     1181                DBGFR3AddrFromHostR0(&pFrame->AddrReturnFrame, pUnwindCtx->m_State.u.x86.FrameAddr.off);
     1182            else
     1183            {
     1184                DBGFADDRESS AddrReturnFrame = pFrame->AddrReturnFrame;
     1185                rc = DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &AddrReturnFrame,
     1186                                          pUnwindCtx->m_State.u.x86.FrameAddr.sel, pUnwindCtx->m_State.u.x86.FrameAddr.off);
     1187                if (RT_SUCCESS(rc))
     1188                    pFrame->AddrReturnFrame = AddrReturnFrame;
     1189            }
    11761190            pFrame->enmReturnFrameReturnType = pUnwindCtx->m_State.enmRetType;
    11771191            pFrame->fFlags                  |= DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET;
     
    12771291        if (pAddrFrame)
    12781292            pCur->AddrFrame = *pAddrFrame;
    1279         else if (   RT_SUCCESS(rc)
    1280                  && dbgfR3UnwindCtxSetPcAndSp(&UnwindCtx, &pCur->AddrPC, &pCur->AddrStack)
    1281                  && dbgfR3UnwindCtxDoOneFrame(&UnwindCtx))
    1282         {
    1283             pCur->enmReturnType = UnwindCtx.m_State.enmRetType;
    1284             pCur->fFlags |= DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO;
    1285             rc = DBGFR3AddrFromSelOff(UnwindCtx.m_pUVM, UnwindCtx.m_idCpu, &pCur->AddrFrame,
    1286                                       UnwindCtx.m_State.u.x86.FrameAddr.sel, UnwindCtx.m_State.u.x86.FrameAddr.off);
    1287         }
    12881293        else if (enmCodeType != DBGFCODETYPE_GUEST)
    12891294            DBGFR3AddrFromFlat(pUVM, &pCur->AddrFrame, pCtx->rbp & fAddrMask);
     
    12911296            rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrFrame, pCtx->ss.Sel, pCtx->rbp & fAddrMask);
    12921297
     1298        /*
     1299         * Try unwind and get a better frame pointer and state.
     1300         */
     1301        if (   RT_SUCCESS(rc)
     1302            && dbgfR3UnwindCtxSetPcAndSp(&UnwindCtx, &pCur->AddrPC, &pCur->AddrStack)
     1303            && dbgfR3UnwindCtxDoOneFrame(&UnwindCtx))
     1304        {
     1305            pCur->enmReturnType = UnwindCtx.m_State.enmRetType;
     1306            pCur->fFlags |= DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO;
     1307            if (!UnwindCtx.m_fIsHostRing0)
     1308                rc = DBGFR3AddrFromSelOff(UnwindCtx.m_pUVM, UnwindCtx.m_idCpu, &pCur->AddrFrame,
     1309                                          UnwindCtx.m_State.u.x86.FrameAddr.sel, UnwindCtx.m_State.u.x86.FrameAddr.off);
     1310            else
     1311                DBGFR3AddrFromHostR0(&pCur->AddrFrame, UnwindCtx.m_State.u.x86.FrameAddr.off);
     1312        }
    12931313        /*
    12941314         * The first frame.
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r73203 r73471  
    24722472    PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
    24732473    AssertReturn(pVCpu, VERR_INVALID_PARAMETER);
    2474 
     2474    AssertReturn(cbRead < ~(size_t)0 / 2, VERR_INVALID_PARAMETER);
     2475
     2476    int rc;
    24752477#ifdef VMM_R0_SWITCH_STACK
    24762478    RTHCUINTPTR off = R0Addr - MMHyperCCToR0(pVM, pVCpu->vmm.s.pbEMTStackR3);
     
    24782480    RTHCUINTPTR off = pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack - (pVCpu->vmm.s.CallRing3JmpBufR0.SpCheck - R0Addr);
    24792481#endif
    2480     if (   off          >  VMM_STACK_SIZE
    2481         || off + cbRead >= VMM_STACK_SIZE)
    2482         return VERR_INVALID_POINTER;
    2483 
    2484     memcpy(pvBuf, &pVCpu->vmm.s.pbEMTStackR3[off], cbRead);
    2485     return VINF_SUCCESS;
     2482    if (   off < VMM_STACK_SIZE
     2483        && off + cbRead <= VMM_STACK_SIZE)
     2484    {
     2485        memcpy(pvBuf, &pVCpu->vmm.s.pbEMTStackR3[off], cbRead);
     2486        rc = VINF_SUCCESS;
     2487    }
     2488    else
     2489        rc = VERR_INVALID_POINTER;
     2490
     2491    /* Supply the setjmp return RIP/EIP.  */
     2492    if (   pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation + sizeof(RTR0UINTPTR) > R0Addr
     2493        && pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation < R0Addr + cbRead)
     2494    {
     2495        uint8_t const  *pbSrc  = (uint8_t const *)&pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcValue;
     2496        size_t          cbSrc  = sizeof(pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcValue);
     2497        size_t          offDst = 0;
     2498        if (R0Addr < pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation)
     2499            offDst = pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation - R0Addr;
     2500        else if (R0Addr > pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation)
     2501        {
     2502            size_t offSrc = R0Addr - pVCpu->vmm.s.CallRing3JmpBufR0.UnwindRetPcLocation;
     2503            Assert(offSrc < cbSrc);
     2504            pbSrc -= offSrc;
     2505            cbSrc -= offSrc;
     2506        }
     2507        if (cbSrc > cbRead - offDst)
     2508            cbSrc = cbRead - offDst;
     2509        memcpy((uint8_t *)pvBuf + offDst, pbSrc, cbSrc);
     2510
     2511        if (cbSrc == cbRead)
     2512            rc = VINF_SUCCESS;
     2513    }
     2514
     2515    return rc;
     2516}
     2517
     2518
     2519/**
     2520 * Used by the DBGF stack unwinder to initialize the register state.
     2521 *
     2522 * @param   pUVM            The user mode VM handle.
     2523 * @param   idCpu           The ID of the CPU being unwound.
     2524 * @param   pState          The unwind state to initialize.
     2525 */
     2526VMMR3_INT_DECL(void) VMMR3InitR0StackUnwindState(PUVM pUVM, VMCPUID idCpu, struct RTDBGUNWINDSTATE *pState)
     2527{
     2528    PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, idCpu);
     2529    AssertReturnVoid(pVCpu);
     2530
     2531    /*
     2532     * Locate the resume point on the stack.
     2533     */
     2534#ifdef VMM_R0_SWITCH_STACK
     2535    uint32_t off = VMMR0JMPBUF.SpResume - MMHyperCCToR0(pVM, pVCpu->vmm.s.pbEMTStackR3);
     2536    AssertReturnVoid(off < VMM_STACK_SIZE);
     2537#else
     2538    uint32_t off = 0;
     2539#endif
     2540
     2541#ifdef RT_ARCH_AMD64
     2542    /*
     2543     * This code must match the .resume stuff in VMMR0JmpA-amd64.asm exactly.
     2544     */
     2545# ifdef VBOX_STRICT
     2546    Assert(*(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off] == UINT32_C(0x7eadf00d));
     2547    off += 8; /* RESUME_MAGIC */
     2548# endif
     2549# ifdef RT_OS_WINDOWS
     2550    off += 0xa0; /* XMM6 thru XMM15 */
     2551# endif
     2552    pState->u.x86.uRFlags              = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2553    off += 8;
     2554    pState->u.x86.auRegs[X86_GREG_xBX] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2555    off += 8;
     2556# ifdef RT_OS_WINDOWS
     2557    pState->u.x86.auRegs[X86_GREG_xSI] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2558    off += 8;
     2559    pState->u.x86.auRegs[X86_GREG_xDI] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2560    off += 8;
     2561# endif
     2562    pState->u.x86.auRegs[X86_GREG_x12] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2563    off += 8;
     2564    pState->u.x86.auRegs[X86_GREG_x13] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2565    off += 8;
     2566    pState->u.x86.auRegs[X86_GREG_x14] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2567    off += 8;
     2568    pState->u.x86.auRegs[X86_GREG_x15] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2569    off += 8;
     2570    pState->u.x86.auRegs[X86_GREG_xBP] = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2571    off += 8;
     2572    pState->uPc                        = *(uint64_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2573    off += 8;
     2574
     2575#elif defined(RT_ARCH_X86)
     2576    /*
     2577     * This code must match the .resume stuff in VMMR0JmpA-x86.asm exactly.
     2578     */
     2579# ifdef VBOX_STRICT
     2580    Assert(*(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off] == UINT32_C(0x7eadf00d));
     2581    off += 4; /* RESUME_MAGIC */
     2582# endif
     2583    pState->u.x86.uRFlags              = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2584    off += 4;
     2585    pState->u.x86.auRegs[X86_GREG_xBX] = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2586    off += 4;
     2587    pState->u.x86.auRegs[X86_GREG_xSI] = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2588    off += 4;
     2589    pState->u.x86.auRegs[X86_GREG_xDI] = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2590    off += 4;
     2591    pState->u.x86.auRegs[X86_GREG_xBP] = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2592    off += 4;
     2593    pState->uPc                        = *(uint32_t const *)&pVCpu->vmm.s.pbEMTStackR3[off];
     2594    off += 4;
     2595#else
     2596# error "Port me"
     2597#endif
     2598
     2599    /*
     2600     * This is all we really need here, though the above helps if the assembly
     2601     * doesn't contain unwind info (currently only on win/64, so that is useful).
     2602     */
     2603    pState->u.x86.auRegs[X86_GREG_xBP] = pVCpu->vmm.s.CallRing3JmpBufR0.SavedEbp;
     2604    pState->u.x86.auRegs[X86_GREG_xSP] = pVCpu->vmm.s.CallRing3JmpBufR0.SpResume;
    24862605}
    24872606
  • trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp

    r73460 r73471  
    452452
    453453                    /* Callstack. */
    454                     DBGFADDRESS pc;
    455                     pc.fFlags    = DBGFADDRESS_FLAGS_RING0 | DBGFADDRESS_FLAGS_VALID;
    456 #if HC_ARCH_BITS == 64
    457                     pc.FlatPtr   = pc.off = pVCpu->vmm.s.CallRing3JmpBufR0.rip;
    458 #else
    459                     pc.FlatPtr   = pc.off = pVCpu->vmm.s.CallRing3JmpBufR0.eip;
    460 #endif
    461                     pc.Sel       = DBGF_SEL_FLAT;
    462 
    463                     DBGFADDRESS ebp;
    464                     ebp.fFlags   = DBGFADDRESS_FLAGS_RING0 | DBGFADDRESS_FLAGS_VALID;
    465                     ebp.FlatPtr  = ebp.off = pVCpu->vmm.s.CallRing3JmpBufR0.SavedEbp;
    466                     ebp.Sel      = DBGF_SEL_FLAT;
    467 
    468                     DBGFADDRESS esp;
    469                     esp.fFlags   = DBGFADDRESS_FLAGS_RING0 | DBGFADDRESS_FLAGS_VALID;
    470                     esp.Sel      = DBGF_SEL_FLAT;
    471                     esp.FlatPtr  = esp.off = pVCpu->vmm.s.CallRing3JmpBufR0.SavedEsp;
    472 
     454                    DBGFADDRESS AddrPc, AddrBp, AddrSp;
    473455                    PCDBGFSTACKFRAME pFirstFrame;
    474                     rc2 = DBGFR3StackWalkBeginEx(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc,
     456                    rc2 = DBGFR3StackWalkBeginEx(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_RING0,
     457                                                 DBGFR3AddrFromHostR0(&AddrBp, pVCpu->vmm.s.CallRing3JmpBufR0.SavedEbp),
     458                                                 DBGFR3AddrFromHostR0(&AddrSp, pVCpu->vmm.s.CallRing3JmpBufR0.SpResume),
     459                                                 DBGFR3AddrFromHostR0(&AddrPc, pVCpu->vmm.s.CallRing3JmpBufR0.SavedEipForUnwind),
    475460                                                 RTDBGRETURNTYPE_INVALID, &pFirstFrame);
    476461                    if (RT_SUCCESS(rc2))
  • trunk/src/VBox/VMM/include/VMMInternal.h

    r73203 r73471  
    183183    /** EBP/RBP at the time of the jump to ring 3. */
    184184    RTHCUINTREG                 SavedEbp;
     185    /** EIP/RIP within vmmR0CallRing3LongJmp for assisting unwinding. */
     186    RTHCUINTREG                 SavedEipForUnwind;
     187    /** Unwind: The vmmR0CallRing3SetJmp return address value. */
     188    RTHCUINTREG                 UnwindRetPcValue;
     189    /** Unwind: The vmmR0CallRing3SetJmp return address stack location. */
     190    RTHCUINTREG                 UnwindRetPcLocation;
    185191
    186192    /** Stats: Max amount of stack used. */
  • trunk/src/VBox/VMM/include/VMMInternal.mac

    r72778 r73471  
    5050    .SavedEsp       resd 1
    5151    .SavedEbp       resd 1
     52    .SavedEipForUnwind      resd 1
     53    .UnwindRetPcValue       resd 1
     54    .UnwindRetPcLocation    resd 1
    5255%endif
    5356%ifdef RT_ARCH_AMD64
     
    8790    .SavedEsp       resq 1
    8891    .SavedEbp       resq 1
     92    .SavedEipForUnwind      resq 1
     93    .UnwindRetPcValue       resq 1
     94    .UnwindRetPcLocation    resq 1
    8995%endif
    9096
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