VirtualBox

Changeset 80156 in vbox


Ignore:
Timestamp:
Aug 6, 2019 1:54:47 PM (6 years ago)
Author:
vboxsync
Message:

DBGFInfo: Added a getopt error reporter helper.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r80153 r80156  
    909909#ifdef IN_RING3 /* The info callbacks API only works in ring-3. */
    910910
     911struct RTGETOPTSTATE;
     912union RTGETOPTUNION;
     913
    911914/**
    912915 * Info helper callback structure.
     
    931934     */
    932935    DECLCALLBACKMEMBER(void, pfnPrintfV)(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(2, 0);
     936
     937    /**
     938     * Report getopt parsing trouble
     939     *
     940     * @param   pHlp        Pointer to this structure.
     941     * @param   rc          The RTGetOpt return value.
     942     * @param   pValueUnion The value union.
     943     * @param   pState      The getopt state.
     944     */
     945    DECLCALLBACKMEMBER(void, pfnGetOptError)(PCDBGFINFOHLP pHlp, int rc, union RTGETOPTUNION *pValueUnion,
     946                                             struct RTGETOPTSTATE *pState);
    933947} DBGFINFOHLP;
    934948
     
    11311145VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogHlp(void);
    11321146VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogRelHlp(void);
     1147VMMR3DECL(void)             DBGFR3InfoGenricGetOptError(PCDBGFINFOHLP pHlp, int rc, union RTGETOPTUNION *pValueUnion,
     1148                                                        struct RTGETOPTSTATE *pState);
    11331149
    11341150#endif /* IN_RING3 */
  • trunk/src/VBox/Debugger/DBGCCmdHlp.cpp

    r80014 r80156  
    13051305    if (!pDbgc->DbgfOutputHlp.pfnPrintf)
    13061306    {
    1307         pDbgc->DbgfOutputHlp.pfnPrintf  = dbgcHlpGetDbgfOutputHlp_Printf;
    1308         pDbgc->DbgfOutputHlp.pfnPrintfV = dbgcHlpGetDbgfOutputHlp_PrintfV;
     1307        pDbgc->DbgfOutputHlp.pfnPrintf      = dbgcHlpGetDbgfOutputHlp_Printf;
     1308        pDbgc->DbgfOutputHlp.pfnPrintfV     = dbgcHlpGetDbgfOutputHlp_PrintfV;
     1309        pDbgc->DbgfOutputHlp.pfnGetOptError = DBGFR3InfoGenricGetOptError;
    13091310    }
    13101311
  • trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp

    r80050 r80156  
    118118{
    119119    return VERR_INTERNAL_ERROR;
     120}
     121VMMR3DECL(void) DBGFR3InfoGenricGetOptError(PCDBGFINFOHLP pHlp, int rc, union RTGETOPTUNION *pValueUnion, struct RTGETOPTSTATE *pState)
     122{
    120123}
    121124VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM)
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r80114 r80156  
    889889static void MachineDebuggerInfoInit(PMACHINEDEBUGGERINOFHLP pHlp)
    890890{
    891     pHlp->Core.pfnPrintf    = MachineDebuggerInfoPrintf;
    892     pHlp->Core.pfnPrintfV   = MachineDebuggerInfoPrintfV;
    893     pHlp->pszBuf            = NULL;
    894     pHlp->cbBuf             = 0;
    895     pHlp->offBuf            = 0;
    896     pHlp->fOutOfMemory      = false;
     891    pHlp->Core.pfnPrintf        = MachineDebuggerInfoPrintf;
     892    pHlp->Core.pfnPrintfV       = MachineDebuggerInfoPrintfV;
     893    pHlp->Core.pfnGetOptError   = DBGFR3InfoGenricGetOptError;
     894    pHlp->pszBuf                = NULL;
     895    pHlp->cbBuf                 = 0;
     896    pHlp->offBuf                = 0;
     897    pHlp->fOutOfMemory          = false;
    897898}
    898899
  • trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp

    r80153 r80156  
    5959{
    6060    dbgfR3InfoLog_Printf,
    61     dbgfR3InfoLog_PrintfV
     61    dbgfR3InfoLog_PrintfV,
     62    DBGFR3InfoGenricGetOptError,
    6263};
    6364
     
    6667{
    6768    dbgfR3InfoLogRel_Printf,
    68     dbgfR3InfoLogRel_PrintfV
     69    dbgfR3InfoLogRel_PrintfV,
     70    DBGFR3InfoGenricGetOptError
    6971};
    7072
     
    7375{
    7476    dbgfR3InfoStdErr_Printf,
    75     dbgfR3InfoStdErr_PrintfV
     77    dbgfR3InfoStdErr_PrintfV,
     78    DBGFR3InfoGenricGetOptError
    7679};
    7780
     
    127130
    128131
    129 /** Logger output.
    130  * @copydoc DBGFINFOHLP::pfnPrintf */
     132/**
     133 * @interface_method_impl{DBGFINFOHLP,pfnGetOptError}
     134 */
     135VMMR3DECL(void) DBGFR3InfoGenricGetOptError(PCDBGFINFOHLP pHlp, int rc, PRTGETOPTUNION pValueUnion, PRTGETOPTSTATE pState)
     136{
     137    RT_NOREF(pState);
     138    char szMsg[1024];
     139    RTGetOptFormatError(szMsg, sizeof(szMsg), rc, pValueUnion);
     140    pHlp->pfnPrintf(pHlp, "syntax error: %s\n", szMsg);
     141}
     142
     143
     144/**
     145 * @interface_method_impl{DBGFINFOHLP,pfnPrintf, Logger output.}
     146 */
    131147static DECLCALLBACK(void) dbgfR3InfoLog_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...)
    132148{
     
    138154}
    139155
    140 /** Logger output.
    141  * @copydoc DBGFINFOHLP::pfnPrintfV */
     156
     157/**
     158 * @interface_method_impl{DBGFINFOHLP,pfnPrintfV, Logger output.}
     159 */
    142160static DECLCALLBACK(void) dbgfR3InfoLog_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args)
    143161{
     
    159177
    160178
    161 /** Release logger output.
    162  * @copydoc DBGFINFOHLP::pfnPrintf */
     179/**
     180 * @interface_method_impl{DBGFINFOHLP,pfnPrintf, Release logger output.}
     181 */
    163182static DECLCALLBACK(void) dbgfR3InfoLogRel_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...)
    164183{
     
    170189}
    171190
    172 /** Release logger output.
    173  * @copydoc DBGFINFOHLP::pfnPrintfV */
     191
     192/**
     193 * @interface_method_impl{DBGFINFOHLP,pfnPrintfV, Release logger output.}
     194 */
    174195static DECLCALLBACK(void) dbgfR3InfoLogRel_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args)
    175196{
     
    179200
    180201
    181 /** Standard error output.
    182  * @copydoc DBGFINFOHLP::pfnPrintf */
     202/**
     203 * @interface_method_impl{DBGFINFOHLP,pfnPrintf, Stdandard error output.}
     204 */
    183205static DECLCALLBACK(void) dbgfR3InfoStdErr_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...)
    184206{
     
    190212}
    191213
    192 /** Standard error output.
    193  * @copydoc DBGFINFOHLP::pfnPrintfV */
     214
     215/**
     216 * @interface_method_impl{DBGFINFOHLP,pfnPrintfV, Stdandard error output.}
     217 */
    194218static DECLCALLBACK(void) dbgfR3InfoStdErr_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args)
    195219{
  • trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp

    r80050 r80156  
    199199    RT_BZERO(pHlp, sizeof(*pHlp));
    200200
    201     pHlp->Core.pfnPrintf  = vmmR3FatalDumpInfoHlp_pfnPrintf;
    202     pHlp->Core.pfnPrintfV = vmmR3FatalDumpInfoHlp_pfnPrintfV;
     201    pHlp->Core.pfnPrintf      = vmmR3FatalDumpInfoHlp_pfnPrintf;
     202    pHlp->Core.pfnPrintfV     = vmmR3FatalDumpInfoHlp_pfnPrintfV;
     203    pHlp->Core.pfnGetOptError = DBGFR3InfoGenricGetOptError;
    203204
    204205    /*
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r80113 r80156  
    102102    DBGFR3InfoRegisterExternal
    103103    DBGFR3InfoDeregisterExternal
     104    DBGFR3InfoGenricGetOptError
    104105    DBGFR3InjectNMI
    105106    DBGFR3LogModifyDestinations
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