VirtualBox

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


Ignore:
Timestamp:
Sep 28, 2020 4:20:50 PM (4 years ago)
Author:
vboxsync
Message:

Debugger: Allow for different I/O providers instead of only TCP

So far TCP was the only option to communicate remotely with the internal debugger, the other option
was to use the console from the GUI directly. This commit reworks basic I/O to allow for different
providers where TCP is just one option. The second one being introduced is an IPC provider using a local
socket or named pipe depending on the platform. This allows for Windows kernel debugging over a pipe
using the KD stub in VirtualBox and WinDbg running on the host (not tested yet).

Furthermore this commit allows multiple stubs to be listening for connections at the same time, so
one can have a GDB stub listening on one TCP port and the native VBox debugger listening on another one
or even using a different I/O provider. Only one session can be active at a time though, because sharing
debugger states is impossible. To configure this the following CFGM keys need to be set for each listener:

"DBGC/<Some unique ID>/Provider" "tcp|ipc"
"DBGC/<Some unique ID>/StubType" "native|gdb|kd"
"DBGC/<Some unique ID>/Address" "<ip>|<local named pipe or socket path>"
"DBGC/<Some unique ID>/Port" "<port>" (for TCP only)

Location:
trunk/src/VBox/Debugger
Files:
4 added
1 deleted
10 edited

Legend:

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

    r86098 r86327  
    401401DECLINLINE(int) dbgcGdbStubCtxWrite(PGDBSTUBCTX pThis, const void *pvPkt, size_t cbPkt)
    402402{
    403     return pThis->Dbgc.pBack->pfnWrite(pThis->Dbgc.pBack, pvPkt, cbPkt, NULL /*pcbWritten*/);
     403    return pThis->Dbgc.pIo->pfnWrite(pThis->Dbgc.pIo, pvPkt, cbPkt, NULL /*pcbWritten*/);
    404404}
    405405
     
    23282328    {
    23292329        size_t cbThisRead = 32;
    2330         rc = pThis->Dbgc.pBack->pfnRead(pThis->Dbgc.pBack, &pThis->pbPktBuf[pThis->offPktBuf], cbThisRead, &cbThisRead);
     2330        rc = pThis->Dbgc.pIo->pfnRead(pThis->Dbgc.pIo, &pThis->pbPktBuf[pThis->offPktBuf], cbThisRead, &cbThisRead);
    23312331        if (RT_SUCCESS(rc))
    23322332            rc = dbgcGdbStubCtxPktBufProcess(pThis, cbThisRead);
     
    24702470        {
    24712471            pThis->Dbgc.fReady = false;
    2472             pThis->Dbgc.pBack->pfnSetReady(pThis->Dbgc.pBack, false);
     2472            pThis->Dbgc.pIo->pfnSetReady(pThis->Dbgc.pIo, false);
    24732473            rc = VERR_GENERAL_FAILURE;
    24742474            break;
     
    25682568     */
    25692569    pThis->Dbgc.fReady = true;
    2570     pThis->Dbgc.pBack->pfnSetReady(pThis->Dbgc.pBack, true);
     2570    pThis->Dbgc.pIo->pfnSetReady(pThis->Dbgc.pIo, true);
    25712571
    25722572    /*
     
    26032603             * Check for input.
    26042604             */
    2605             if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, 0))
     2605            if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, 0))
    26062606            {
    26072607                rc = dbgcGdbStubCtxRecv(pThis);
     
    26152615             * Wait for input.
    26162616             */
    2617             if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, 1000))
     2617            if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, 1000))
    26182618            {
    26192619                rc = dbgcGdbStubCtxRecv(pThis);
     
    26752675 * @returns VBox status code.
    26762676 * @param   ppGdbStubCtx            Where to store the pointer to the GDB stub context instance on success.
    2677  * @param   pBack                   The backend to use for I/O.
     2677 * @param   pIo                     Pointer to the I/O callback table.
    26782678 * @param   fFlags                  Flags controlling the behavior.
    26792679 */
    2680 static int dbgcGdbStubCtxCreate(PPGDBSTUBCTX ppGdbStubCtx, PDBGCBACK pBack, unsigned fFlags)
     2680static int dbgcGdbStubCtxCreate(PPGDBSTUBCTX ppGdbStubCtx, PCDBGCIO pIo, unsigned fFlags)
    26812681{
    26822682    /*
    26832683     * Validate input.
    26842684     */
    2685     AssertPtrReturn(pBack, VERR_INVALID_POINTER);
     2685    AssertPtrReturn(pIo, VERR_INVALID_POINTER);
    26862686    AssertMsgReturn(!fFlags, ("%#x", fFlags), VERR_INVALID_PARAMETER);
    26872687
     
    26982698     * in DBGCConsole.cpp. Try to keep both functions in sync.
    26992699     */
    2700     pThis->Dbgc.pBack            = pBack;
     2700    pThis->Dbgc.pIo              = pIo;
    27012701    pThis->Dbgc.pfnOutput        = dbgcOutputGdb;
    27022702    pThis->Dbgc.pvOutputUser     = pThis;
     
    27912791
    27922792
    2793 DECLHIDDEN(int) dbgcGdbStubCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags)
     2793DECL_HIDDEN_CALLBACK(int) dbgcGdbStubRunloop(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags)
    27942794{
    27952795    /*
     
    28082808     */
    28092809    PGDBSTUBCTX pThis;
    2810     int rc = dbgcGdbStubCtxCreate(&pThis, pBack, fFlags);
     2810    int rc = dbgcGdbStubCtxCreate(&pThis, pIo, fFlags);
    28112811    if (RT_FAILURE(rc))
    28122812        return rc;
  • trunk/src/VBox/Debugger/DBGCInternal.h

    r86105 r86327  
    114114    /** Wrappers for DBGF output. */
    115115    DBGFINFOHLP         DbgfOutputHlp;
    116     /** Pointer to backend callback structure. */
    117     PDBGCBACK           pBack;
     116    /** Pointer to I/O callback structure. */
     117    PCDBGCIO            pIo;
    118118
    119119    /**
     
    594594
    595595/* For tstDBGCParser: */
    596 int     dbgcCreate(PDBGC *ppDbgc, PDBGCBACK pBack, unsigned fFlags);
     596int     dbgcCreate(PDBGC *ppDbgc, PCDBGCIO pIo, unsigned fFlags);
    597597int     dbgcRun(PDBGC pDbgc);
    598598int     dbgcProcessInput(PDBGC pDbgc, bool fNoExecute);
     
    602602DECLHIDDEN(PCDBGCSXEVT) dbgcEventLookup(DBGFEVENTTYPE enmType);
    603603
    604 DECLHIDDEN(int) dbgcGdbStubCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags);
    605 DECLHIDDEN(int) dbgcKdStubCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags);
     604DECL_HIDDEN_CALLBACK(int) dbgcGdbStubRunloop(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags);
     605DECL_HIDDEN_CALLBACK(int) dbgcKdStubRunloop(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags);
    606606
    607607
  • trunk/src/VBox/Debugger/DBGCRemoteKd.cpp

    r86246 r86327  
    17361736DECLINLINE(int) dbgcKdCtxWrite(PKDCTX pThis, const void *pvPkt, size_t cbPkt)
    17371737{
    1738     return pThis->Dbgc.pBack->pfnWrite(pThis->Dbgc.pBack, pvPkt, cbPkt, NULL /*pcbWritten*/);
     1738    return pThis->Dbgc.pIo->pfnWrite(pThis->Dbgc.pIo, pvPkt, cbPkt, NULL /*pcbWritten*/);
    17391739}
    17401740
     
    22932293           && RT_SUCCESS(rc))
    22942294    {
    2295         if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, msWait))
     2295        if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, msWait))
    22962296        {
    22972297            size_t cbRead = 0;
    2298             rc = pThis->Dbgc.pBack->pfnRead(pThis->Dbgc.pBack, pbCur, 1, &cbRead);
     2298            rc = pThis->Dbgc.pIo->pfnRead(pThis->Dbgc.pIo, pbCur, 1, &cbRead);
    22992299            if (   RT_SUCCESS(rc)
    23002300                && cbRead == 1)
     
    23282328               && cbLeft)
    23292329        {
    2330             if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, msWait))
     2330            if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, msWait))
    23312331            {
    23322332                size_t cbRead = 0;
    2333                 rc = pThis->Dbgc.pBack->pfnRead(pThis->Dbgc.pBack, pbCur, cbLeft, &cbRead);
     2333                rc = pThis->Dbgc.pIo->pfnRead(pThis->Dbgc.pIo, pbCur, cbLeft, &cbRead);
    23342334                if (RT_SUCCESS(rc))
    23352335                {
     
    38553855    {
    38563856        size_t cbRead = 0;
    3857         rc = pThis->Dbgc.pBack->pfnRead(pThis->Dbgc.pBack, pThis->pbRecv, pThis->cbRecvLeft, &cbRead);
     3857        rc = pThis->Dbgc.pIo->pfnRead(pThis->Dbgc.pIo, pThis->pbRecv, pThis->cbRecvLeft, &cbRead);
    38583858        if (RT_SUCCESS(rc))
    38593859        {
     
    40164016        {
    40174017            pThis->Dbgc.fReady = false;
    4018             pThis->Dbgc.pBack->pfnSetReady(pThis->Dbgc.pBack, false);
     4018            pThis->Dbgc.pIo->pfnSetReady(pThis->Dbgc.pIo, false);
    40194019            rc = VERR_GENERAL_FAILURE;
    40204020            break;
     
    41414141     */
    41424142    pThis->Dbgc.fReady = true;
    4143     pThis->Dbgc.pBack->pfnSetReady(pThis->Dbgc.pBack, true);
     4143    pThis->Dbgc.pIo->pfnSetReady(pThis->Dbgc.pIo, true);
    41444144
    41454145    /*
     
    41764176             * Check for input.
    41774177             */
    4178             if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, 0))
     4178            if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, 0))
    41794179            {
    41804180                rc = dbgcKdCtxRecv(pThis);
     
    41884188             * Wait for input.
    41894189             */
    4190             if (pThis->Dbgc.pBack->pfnInput(pThis->Dbgc.pBack, 1000))
     4190            if (pThis->Dbgc.pIo->pfnInput(pThis->Dbgc.pIo, 1000))
    41914191            {
    41924192                rc = dbgcKdCtxRecv(pThis);
     
    42114211 * @returns VBox status code.
    42124212 * @param   ppKdCtx                 Where to store the pointer to the KD stub context instance on success.
    4213  * @param   pBack                   The backend to use for I/O.
     4213 * @param   pIo                     Pointer to the I/O callback table.
    42144214 * @param   fFlags                  Flags controlling the behavior.
    42154215 */
    4216 static int dbgcKdCtxCreate(PPKDCTX ppKdCtx, PDBGCBACK pBack, unsigned fFlags)
     4216static int dbgcKdCtxCreate(PPKDCTX ppKdCtx, PCDBGCIO pIo, unsigned fFlags)
    42174217{
    42184218    /*
    42194219     * Validate input.
    42204220     */
    4221     AssertPtrReturn(pBack, VERR_INVALID_POINTER);
     4221    AssertPtrReturn(pIo, VERR_INVALID_POINTER);
    42224222    AssertMsgReturn(!fFlags, ("%#x", fFlags), VERR_INVALID_PARAMETER);
    42234223
     
    42344234     * in DBGCConsole.cpp. Try to keep both functions in sync.
    42354235     */
    4236     pThis->Dbgc.pBack            = pBack;
     4236    pThis->Dbgc.pIo              = pIo;
    42374237    pThis->Dbgc.pfnOutput        = dbgcKdOutput;
    42384238    pThis->Dbgc.pvOutputUser     = pThis;
     
    43324332
    43334333
    4334 DECLHIDDEN(int) dbgcKdStubCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags)
     4334DECL_HIDDEN_CALLBACK(int) dbgcKdStubRunloop(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags)
    43354335{
    43364336    /*
     
    43494349     */
    43504350    PKDCTX pThis;
    4351     int rc = dbgcKdCtxCreate(&pThis, pBack, fFlags);
     4351    int rc = dbgcKdCtxCreate(&pThis, pIo, fFlags);
    43524352    if (RT_FAILURE(rc))
    43534353        return rc;
  • trunk/src/VBox/Debugger/DBGConsole.cpp

    r86105 r86327  
    410410     * When finding a '\n' we'll continue normal processing.
    411411     */
    412     while (pDbgc->pBack->pfnInput(pDbgc->pBack, 0))
     412    while (pDbgc->pIo->pfnInput(pDbgc->pIo, 0))
    413413    {
    414414        size_t cbRead;
    415         int rc = pDbgc->pBack->pfnRead(pDbgc->pBack, &pDbgc->achInput[0], sizeof(pDbgc->achInput) - 1, &cbRead);
     415        int rc = pDbgc->pIo->pfnRead(pDbgc->pIo, &pDbgc->achInput[0], sizeof(pDbgc->achInput) - 1, &cbRead);
    416416        if (RT_FAILURE(rc))
    417417            return rc;
     
    469469        char    achRead[128];
    470470        size_t  cbRead;
    471         rc = pDbgc->pBack->pfnRead(pDbgc->pBack, &achRead[0], RT_MIN(cbLeft, sizeof(achRead)), &cbRead);
     471        rc = pDbgc->pIo->pfnRead(pDbgc->pIo, &achRead[0], RT_MIN(cbLeft, sizeof(achRead)), &cbRead);
    472472        if (RT_FAILURE(rc))
    473473            return rc;
     
    527527        /* Terminate it to make it easier to read in the debugger. */
    528528        pDbgc->achInput[pDbgc->iWrite] = '\0';
    529     } while (pDbgc->pBack->pfnInput(pDbgc->pBack, 0));
     529    } while (pDbgc->pIo->pfnInput(pDbgc->pIo, 0));
    530530
    531531    return rc;
     
    554554    if (pDbgc->cInputLines)
    555555    {
    556         pDbgc->pBack->pfnSetReady(pDbgc->pBack, false);
     556        pDbgc->pIo->pfnSetReady(pDbgc->pIo, false);
    557557        pDbgc->fReady = false;
    558558        rc = dbgcProcessCommands(pDbgc, fNoExecute);
     
    567567        if (    RT_SUCCESS(rc)
    568568            &&  pDbgc->fReady)
    569             pDbgc->pBack->pfnSetReady(pDbgc->pBack, true);
     569            pDbgc->pIo->pfnSetReady(pDbgc->pIo, true);
    570570    }
    571571    /*
     
    810810        {
    811811            pDbgc->fReady = false;
    812             pDbgc->pBack->pfnSetReady(pDbgc->pBack, false);
     812            pDbgc->pIo->pfnSetReady(pDbgc->pIo, false);
    813813            pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\nVM is powering off!\n");
    814814            fPrintPrompt = false;
     
    890890        pDbgc->fReady = true;
    891891        if (RT_SUCCESS(rc))
    892             pDbgc->pBack->pfnSetReady(pDbgc->pBack, true);
     892            pDbgc->pIo->pfnSetReady(pDbgc->pIo, true);
    893893        pDbgc->cMultiStepsLeft = 0;
    894894    }
     
    935935     */
    936936    pDbgc->fReady = true;
    937     pDbgc->pBack->pfnSetReady(pDbgc->pBack, true);
     937    pDbgc->pIo->pfnSetReady(pDbgc->pIo, true);
    938938
    939939    /*
     
    970970             * Check for input.
    971971             */
    972             if (pDbgc->pBack->pfnInput(pDbgc->pBack, 0))
     972            if (pDbgc->pIo->pfnInput(pDbgc->pIo, 0))
    973973            {
    974974                rc = dbgcProcessInput(pDbgc, false /* fNoExecute */);
     
    982982             * Wait for input. If Logging is enabled we'll only wait very briefly.
    983983             */
    984             if (pDbgc->pBack->pfnInput(pDbgc->pBack, pDbgc->fLog ? 1 : 1000))
     984            if (pDbgc->pIo->pfnInput(pDbgc->pIo, pDbgc->fLog ? 1 : 1000))
    985985            {
    986986                rc = dbgcProcessInput(pDbgc, false /* fNoExecute */);
     
    10521052                                  "HistoryFile|"
    10531053                                  "LocalInitScript|"
    1054                                   "GlobalInitScript|"
    1055                                   "StubType",
    1056                                   "", "DBGC", 0);
     1054                                  "GlobalInitScript|",
     1055                                  "*", "DBGC", 0);
    10571056    AssertRCReturn(rc, rc);
    10581057
     
    11131112{
    11141113    PDBGC pDbgc = (PDBGC)pvUser;
    1115     return pDbgc->pBack->pfnWrite(pDbgc->pBack, pachChars, cbChars, NULL /*pcbWritten*/);
     1114    return pDbgc->pIo->pfnWrite(pDbgc->pIo, pachChars, cbChars, NULL /*pcbWritten*/);
    11161115}
    11171116
     
    11221121 * @returns VBox status code.
    11231122 * @param   ppDbgc      Where to store the pointer to the instance data.
    1124  * @param   pBack       Pointer to the backend.
     1123 * @param   pIo         Pointer to the I/O callback table.
    11251124 * @param   fFlags      The flags.
    11261125 */
    1127 int dbgcCreate(PDBGC *ppDbgc, PDBGCBACK pBack, unsigned fFlags)
     1126int dbgcCreate(PDBGC *ppDbgc, PCDBGCIO pIo, unsigned fFlags)
    11281127{
    11291128    /*
    11301129     * Validate input.
    11311130     */
    1132     AssertPtrReturn(pBack, VERR_INVALID_POINTER);
     1131    AssertPtrReturn(pIo, VERR_INVALID_POINTER);
    11331132    AssertMsgReturn(!fFlags, ("%#x", fFlags), VERR_INVALID_PARAMETER);
    11341133
     
    11411140
    11421141    dbgcInitCmdHlp(pDbgc);
    1143     pDbgc->pBack            = pBack;
     1142    pDbgc->pIo              = pIo;
    11441143    pDbgc->pfnOutput        = dbgcOutputNative;
    11451144    pDbgc->pvOutputUser     = pDbgc;
     
    12361235 *
    12371236 * @param   pUVM        The user mode VM handle.
    1238  * @param   pBack       Pointer to the backend structure. This must contain
     1237 * @param   pIo         Pointer to the I/O callback structure. This must contain
    12391238 *                      a full set of function pointers to service the console.
    12401239 * @param   fFlags      Reserved, must be zero.
     
    12421241 *          callbacks to return fatal failures.
    12431242 */
    1244 DBGDECL(int) DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags)
     1243DBGDECL(int) DBGCCreate(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags)
    12451244{
    12461245    /*
     
    12591258     */
    12601259    PDBGC pDbgc;
    1261     int rc = dbgcCreate(&pDbgc, pBack, fFlags);
     1260    int rc = dbgcCreate(&pDbgc, pIo, fFlags);
    12621261    if (RT_FAILURE(rc))
    12631262        return rc;
  • trunk/src/VBox/Debugger/Makefile.kmk

    r86105 r86327  
    5151        DBGCGdbRemoteStub.cpp \
    5252        DBGCRemoteKd.cpp \
    53         DBGCTcp.cpp \
     53        DBGCIo.cpp \
     54        DBGCIoProvTcp.cpp \
     55        DBGCIoProvIpc.cpp \
    5456        DBGCScreenAscii.cpp
    5557
  • trunk/src/VBox/Debugger/VBoxDbgBase.cpp

    r85844 r86327  
    9696
    9797int
    98 VBoxDbgBase::dbgcCreate(PDBGCBACK pBack, unsigned fFlags)
     98VBoxDbgBase::dbgcCreate(PCDBGCIO pIo, unsigned fFlags)
    9999{
    100100    PUVM pUVM = m_pUVM;
    101101    if (    pUVM
    102102        &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
    103         return DBGCCreate(pUVM, pBack, fFlags);
     103        return DBGCCreate(pUVM, pIo, fFlags);
    104104    return VERR_INVALID_HANDLE;
    105105}
  • trunk/src/VBox/Debugger/VBoxDbgBase.h

    r82968 r86327  
    8787     * Wrapper for DBGCCreate().
    8888     */
    89     int dbgcCreate(PDBGCBACK pBack, unsigned fFlags);
     89    int dbgcCreate(PCDBGCIO pIo, unsigned fFlags);
    9090    /** @} */
    9191
  • trunk/src/VBox/Debugger/VBoxDbgConsole.cpp

    r86004 r86327  
    740740 */
    741741/*static*/ DECLCALLBACK(bool)
    742 VBoxDbgConsole::backInput(PDBGCBACK pBack, uint32_t cMillies)
    743 {
    744     VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCBACK(pBack);
     742VBoxDbgConsole::backInput(PCDBGCIO pBack, uint32_t cMillies)
     743{
     744    VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCIO(pBack);
    745745    pThis->lock();
    746746
     
    775775 */
    776776/*static*/ DECLCALLBACK(int)
    777 VBoxDbgConsole::backRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead)
    778 {
    779     VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCBACK(pBack);
     777VBoxDbgConsole::backRead(PCDBGCIO pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead)
     778{
     779    VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCIO(pBack);
    780780    Assert(pcbRead); /** @todo implement this bit */
    781781    if (pcbRead)
     
    817817 */
    818818/*static*/ DECLCALLBACK(int)
    819 VBoxDbgConsole::backWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten)
    820 {
    821     VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCBACK(pBack);
     819VBoxDbgConsole::backWrite(PCDBGCIO pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten)
     820{
     821    VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCIO(pBack);
    822822    int rc = VINF_SUCCESS;
    823823
     
    864864
    865865/*static*/ DECLCALLBACK(void)
    866 VBoxDbgConsole::backSetReady(PDBGCBACK pBack, bool fReady)
    867 {
    868     VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCBACK(pBack);
     866VBoxDbgConsole::backSetReady(PCDBGCIO pBack, bool fReady)
     867{
     868    VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCIO(pBack);
    869869    if (fReady)
    870870        QApplication::postEvent(pThis, new VBoxDbgConsoleEvent(VBoxDbgConsoleEvent::kInputEnable));
  • trunk/src/VBox/Debugger/VBoxDbgConsole.h

    r82968 r86327  
    289289     * @param   cMillies    Number of milliseconds to wait on input data.
    290290     */
    291     static DECLCALLBACK(bool) backInput(PDBGCBACK pBack, uint32_t cMillies);
     291    static DECLCALLBACK(bool) backInput(PCDBGCIO pIo, uint32_t cMillies);
    292292
    293293    /**
     
    302302     *                      successful return.
    303303     */
    304     static DECLCALLBACK(int) backRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead);
     304    static DECLCALLBACK(int) backRead(PCDBGCIO pIo, void *pvBuf, size_t cbBuf, size_t *pcbRead);
    305305
    306306    /**
     
    314314     *                      If NULL the entire buffer must be successfully written.
    315315     */
    316     static DECLCALLBACK(int) backWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);
    317 
    318     /**
    319      * @copydoc FNDBGCBACKSETREADY
    320      */
    321     static DECLCALLBACK(void) backSetReady(PDBGCBACK pBack, bool fReady);
     316    static DECLCALLBACK(int) backWrite(PCDBGCIO pIo, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);
     317
     318    /**
     319     * @copydoc DBGCIO::PfnSetReady
     320     */
     321    static DECLCALLBACK(void) backSetReady(PCDBGCIO pIo, bool fReady);
    322322
    323323    /**
     
    388388
    389389    /** The debug console backend structure.
    390      * Use VBOXDBGCONSOLE_FROM_DBGCBACK to convert the DBGCBACK pointer to a object pointer. */
     390     * Use VBOXDBGCONSOLE_FROM_DBGCIO to convert the DBGCIO pointer to a object pointer. */
    391391    struct VBoxDbgConsoleBack
    392392    {
    393         DBGCBACK Core;
     393        DBGCIO Core;
    394394        VBoxDbgConsole *pSelf;
    395395    } m_Back;
     
    399399     * @todo find a better way because offsetof is undefined on objects and g++ gets very noisy because of that.
    400400     */
    401 #   define VBOXDBGCONSOLE_FROM_DBGCBACK(pBack) ( ((struct VBoxDbgConsoleBack *)(pBack))->pSelf )
     401#   define VBOXDBGCONSOLE_FROM_DBGCIO(pIo) ( ((struct VBoxDbgConsoleBack *)(pBack))->pSelf )
    402402
    403403    /** Change focus to the input field. */
  • trunk/src/VBox/Debugger/testcase/tstDBGCParser.cpp

    r82968 r86327  
    3131*   Internal Functions                                                                                                           *
    3232*********************************************************************************************************************************/
    33 static DECLCALLBACK(bool) tstDBGCBackInput(PDBGCBACK pBack, uint32_t cMillies);
    34 static DECLCALLBACK(int)  tstDBGCBackRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead);
    35 static DECLCALLBACK(int)  tstDBGCBackWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);
    36 static DECLCALLBACK(void) tstDBGCBackSetReady(PDBGCBACK pBack, bool fReady);
     33static DECLCALLBACK(bool) tstDBGCBackInput(PCDBGCIO pBack, uint32_t cMillies);
     34static DECLCALLBACK(int)  tstDBGCBackRead(PCDBGCIO pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead);
     35static DECLCALLBACK(int)  tstDBGCBackWrite(PCDBGCIO pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);
     36static DECLCALLBACK(void) tstDBGCBackSetReady(PCDBGCIO pBack, bool fReady);
    3737
    3838
     
    4343static RTTEST g_hTest = NIL_RTTEST;
    4444
    45 /** The DBGC backend structure for use in this testcase. */
    46 static DBGCBACK g_tstBack =
    47 {
     45/** The DBGC I/O structure for use in this testcase. */
     46static DBGCIO g_tstBack =
     47{
     48    NULL, /**pfnDestroy*/
    4849    tstDBGCBackInput,
    4950    tstDBGCBackRead,
     
    7172 * @param   cMillies    Number of milliseconds to wait on input data.
    7273 */
    73 static DECLCALLBACK(bool) tstDBGCBackInput(PDBGCBACK pBack, uint32_t cMillies)
     74static DECLCALLBACK(bool) tstDBGCBackInput(PCDBGCIO pBack, uint32_t cMillies)
    7475{
    7576    return g_pszInput != NULL
     
    9192 *                      successful return.
    9293 */
    93 static DECLCALLBACK(int) tstDBGCBackRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead)
     94static DECLCALLBACK(int) tstDBGCBackRead(PCDBGCIO pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead)
    9495{
    9596    if (g_pszInput && *g_pszInput)
     
    120121 *                      If NULL the entire buffer must be successfully written.
    121122 */
    122 static DECLCALLBACK(int) tstDBGCBackWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten)
     123static DECLCALLBACK(int) tstDBGCBackWrite(PCDBGCIO pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten)
    123124{
    124125    const char *pch = (const char *)pvBuf;
     
    159160 * @param   fReady      Whether it's ready (true) or busy (false).
    160161 */
    161 static DECLCALLBACK(void) tstDBGCBackSetReady(PDBGCBACK pBack, bool fReady)
     162static DECLCALLBACK(void) tstDBGCBackSetReady(PCDBGCIO pBack, bool fReady)
    162163{
    163164}
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