VirtualBox

Changeset 84765 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jun 10, 2020 5:39:10 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138564
Message:

VMM/PDMDevice: Need to assign the device helper tracing variant before calling the constructor to catch all interesting events, bugref:9210

File:
1 edited

Legend:

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

    r84459 r84765  
    497497        }
    498498
     499#ifdef VBOX_WITH_DBGF_TRACING
     500        /*
     501         * Allocate memory for the MMIO/IO port registration tracking if DBGF tracing is enabled.
     502         */
     503        if (hDbgfTraceEvtSrc != NIL_DBGFTRACEREVTSRC)
     504        {
     505            pDevIns->Internal.s.paDbgfTraceTrack = (PPDMDEVINSDBGFTRACK)RTMemAllocZ(PDM_MAX_DEVICE_DBGF_TRACING_TRACK);
     506            if (!pDevIns->Internal.s.paDbgfTraceTrack)
     507            {
     508                LogRel(("PDM: Failed to construct '%s'/%d! %Rra\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_NO_MEMORY));
     509                if (VMR3GetErrorCount(pVM->pUVM) == 0)
     510                    VMSetError(pVM, rc, RT_SRC_POS, "Failed to construct device '%s' instance #%u",
     511                               pDevIns->pReg->szName, pDevIns->iInstance);
     512                paDevs[i].pDev->cInstances--;
     513                return VERR_NO_MEMORY;
     514            }
     515
     516            pDevIns->Internal.s.idxDbgfTraceTrackNext = 0;
     517            pDevIns->Internal.s.cDbgfTraceTrackMax = PDM_MAX_DEVICE_DBGF_TRACING_TRACK / sizeof(PDMDEVINSDBGFTRACK);
     518            pDevIns->pHlpR3 = &g_pdmR3DevHlpTracing;
     519        }
     520#endif
     521
    499522        /*
    500523         * Call the constructor.
     
    514537            return rc == VERR_VERSION_MISMATCH ? VERR_PDM_DEVICE_VERSION_MISMATCH : rc;
    515538        }
    516 
    517 #ifdef VBOX_WITH_DBGF_TRACING
    518         /*
    519          * Allocate memory for the MMIO/IO port registration tracking if DBGF tracing is enabled.
    520          */
    521         if (hDbgfTraceEvtSrc != NIL_DBGFTRACEREVTSRC)
    522         {
    523             pDevIns->Internal.s.paDbgfTraceTrack = (PPDMDEVINSDBGFTRACK)RTMemAllocZ(PDM_MAX_DEVICE_DBGF_TRACING_TRACK);
    524             if (!pDevIns->Internal.s.paDbgfTraceTrack)
    525             {
    526                 LogRel(("PDM: Failed to construct '%s'/%d! %Rra\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_NO_MEMORY));
    527                 if (VMR3GetErrorCount(pVM->pUVM) == 0)
    528                     VMSetError(pVM, rc, RT_SRC_POS, "Failed to construct device '%s' instance #%u",
    529                                pDevIns->pReg->szName, pDevIns->iInstance);
    530                 paDevs[i].pDev->cInstances--;
    531                 return VERR_NO_MEMORY;
    532             }
    533 
    534             pDevIns->Internal.s.idxDbgfTraceTrackNext = 0;
    535             pDevIns->Internal.s.cDbgfTraceTrackMax = PDM_MAX_DEVICE_DBGF_TRACING_TRACK / sizeof(PDMDEVINSDBGFTRACK);
    536             pDevIns->pHlpR3 = &g_pdmR3DevHlpTracing;
    537         }
    538 #endif
    539539
    540540        /*
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