VirtualBox

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


Ignore:
Timestamp:
Jul 12, 2018 9:06:33 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123672
Message:

*: Made RT_UOFFSETOF, RT_OFFSETOF, RT_UOFFSETOF_ADD and RT_OFFSETOF_ADD work like builtin_offsetof() and require compile time resolvable requests, adding RT_UOFFSETOF_DYN for the dynamic questions that can only be answered at runtime.

Location:
trunk/src/VBox/Debugger
Files:
6 edited

Legend:

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

    r69500 r73097  
    6363        pszCmd = RTStrStripL(pszCmd);
    6464    size_t cchCmd = pszCmd ? strlen(pszCmd) : 0;
    65     pBp = (PDBGCBP)RTMemAlloc(RT_OFFSETOF(DBGCBP, szCmd[cchCmd + 1]));
     65    pBp = (PDBGCBP)RTMemAlloc(RT_UOFFSETOF_DYN(DBGCBP, szCmd[cchCmd + 1]));
    6666    if (!pBp)
    6767        return VERR_NO_MEMORY;
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r73077 r73097  
    53215321            {
    53225322                RTMemFree(pEvtCfg);
    5323                 *ppEvtCfg = pEvtCfg = (PDBGCEVTCFG)RTMemAlloc(RT_OFFSETOF(DBGCEVTCFG, szCmd[cchCmd + 1]));
     5323                *ppEvtCfg = pEvtCfg = (PDBGCEVTCFG)RTMemAlloc(RT_UOFFSETOF_DYN(DBGCEVTCFG, szCmd[cchCmd + 1]));
    53245324                if (!pEvtCfg)
    53255325                    return VERR_NO_MEMORY;
  • trunk/src/VBox/Debugger/DBGCInternal.h

    r69500 r73097  
    236236
    237237/** Converts a Command Helper pointer to a pointer to DBGC instance data. */
    238 #define DBGC_CMDHLP2DBGC(pCmdHlp)   ( (PDBGC)((uintptr_t)(pCmdHlp) - RT_OFFSETOF(DBGC, CmdHlp)) )
     238#define DBGC_CMDHLP2DBGC(pCmdHlp)   ( (PDBGC)((uintptr_t)(pCmdHlp) - RT_UOFFSETOF(DBGC, CmdHlp)) )
    239239
    240240
  • trunk/src/VBox/Debugger/DBGCTcp.cpp

    r69500 r73097  
    5151
    5252/** Converts a pointer to DBGCTCP::Back to a pointer to DBGCTCP. */
    53 #define DBGCTCP_BACK2DBGCTCP(pBack) ( (PDBGCTCP)((char *)pBack - RT_OFFSETOF(DBGCTCP, Back)) )
     53#define DBGCTCP_BACK2DBGCTCP(pBack) ( (PDBGCTCP)((char *)(pBack) - RT_UOFFSETOF(DBGCTCP, Back)) )
    5454
    5555
  • trunk/src/VBox/Debugger/DBGPlugInLinux.cpp

    r69820 r73097  
    21332133        if (*pszCfgCur == '\"')
    21342134        {
    2135             pCfgItem = (PDBGDIGGERLINUXCFGITEM)RTMemAllocZ(RT_OFFSETOF(DBGDIGGERLINUXCFGITEM, u.aszString[pszCfgCur - pszCfg + 1]));
     2135            pCfgItem = (PDBGDIGGERLINUXCFGITEM)RTMemAllocZ(RT_UOFFSETOF_DYN(DBGDIGGERLINUXCFGITEM,
     2136                                                                            u.aszString[pszCfgCur - pszCfg + 1]));
    21362137            if (pCfgItem)
    21372138            {
  • trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp

    r70338 r73097  
    499499     */
    500500    uint32_t const      cShs = WINNT_UNION(pThis, pHdrs, FileHeader.NumberOfSections);
    501     PDBGDIGGERWINNTRDR  pRdr = (PDBGDIGGERWINNTRDR)RTMemAlloc(RT_OFFSETOF(DBGDIGGERWINNTRDR, aMappings[cShs + 2]));
     501    PDBGDIGGERWINNTRDR  pRdr = (PDBGDIGGERWINNTRDR)RTMemAlloc(RT_UOFFSETOF_DYN(DBGDIGGERWINNTRDR, aMappings[cShs + 2]));
    502502    if (!pRdr)
    503503        return VERR_NO_MEMORY;
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