VirtualBox

Ignore:
Timestamp:
Sep 13, 2020 8:28:59 AM (4 years ago)
Author:
vboxsync
Message:

Debugger/RemoteKd: Add beginnings of debug stub talking the KD remote protocol (WinDbg and friends), heavy work in progress

File:
1 edited

Legend:

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

    r84627 r86105  
    223223    PUVM pUVM = (PUVM)pvUser;
    224224    PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "DBGC");
    225     bool fGdbStub = false;
    226     int rc = CFGMR3QueryBoolDef(pKey, "GdbStub", &fGdbStub, false);
    227     if (RT_FAILURE(rc))
    228         return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/GdbStub\"");
     225    char *pszStubType = NULL;
     226    int rc = CFGMR3QueryStringAllocDef(pKey, "StubType", &pszStubType, "Native");
     227    if (RT_FAILURE(rc))
     228        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/StubType\"");
    229229
    230230    /*
     
    234234    DbgcTcp.Back.pfnInput     = dbgcTcpBackInput;
    235235    DbgcTcp.Back.pfnRead      = dbgcTcpBackRead;
    236     if (fGdbStub)
    237         DbgcTcp.Back.pfnWrite = dbgcTcpBackWriteRaw;
    238     else
    239         DbgcTcp.Back.pfnWrite = dbgcTcpBackWrite;
    240236    DbgcTcp.Back.pfnSetReady  = dbgcTcpBackSetReady;
    241237    DbgcTcp.fAlive = true;
    242238    DbgcTcp.Sock   = Sock;
    243     if (fGdbStub)
     239
     240    if (!RTStrICmp(pszStubType, "gdb"))
     241    {
     242        DbgcTcp.Back.pfnWrite = dbgcTcpBackWriteRaw;
    244243        rc = dbgcGdbStubCreate(pUVM, &DbgcTcp.Back, 0);
     244    }
     245    else if (!RTStrICmp(pszStubType, "kd"))
     246    {
     247        DbgcTcp.Back.pfnWrite = dbgcTcpBackWriteRaw;
     248        rc = dbgcKdStubCreate(pUVM, &DbgcTcp.Back, 0);
     249    }
     250    else if (!RTStrICmp(pszStubType, "native"))
     251    {
     252        DbgcTcp.Back.pfnWrite = dbgcTcpBackWrite;
     253        rc = DBGCCreate(pUVM, &DbgcTcp.Back, 0);
     254    }
    245255    else
    246         rc = DBGCCreate(pUVM, &DbgcTcp.Back, 0);
     256        rc = VM_SET_ERROR_U(pUVM, VERR_INVALID_PARAMETER, "Configuration error: \"DBGC/StubType\" contains an invalid type");
     257
    247258    LogFlow(("dbgcTcpConnection: disconnect rc=%Rrc\n", rc));
    248259    return rc;
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