VirtualBox

Changeset 12880 in vbox for trunk


Ignore:
Timestamp:
Oct 1, 2008 9:45:19 PM (16 years ago)
Author:
vboxsync
Message:

Debugger: fixed busy/ready.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dbg.h

    r12653 r12880  
    644644typedef FNDBGCBACKWRITE *PFNDBGCBACKWRITE;
    645645
     646/**
     647 * Ready / busy notification.
     648 *
     649 * @param   pBack       Pointer to the backend structure supplied by
     650 *                      the backend. The backend can use this to find
     651 *                      it's instance data.
     652 * @param   fReady      Whether it's ready (true) or busy (false).
     653 */
     654typedef DECLCALLBACK(void) FNDBGCBACKSETREADY(PDBGCBACK pBack, bool fReady);
     655/** Pointer to a FNDBGCBACKSETREADY() callback. */
     656typedef FNDBGCBACKSETREADY *PFNDBGCBACKSETREADY;
     657
    646658
    647659/**
     
    657669    /** Write output. */
    658670    PFNDBGCBACKWRITE    pfnWrite;
     671    /** Ready / busy notification. */
     672    PFNDBGCBACKSETREADY pfnSetReady;
    659673} DBGCBACK;
    660674
  • trunk/src/VBox/Debugger/DBGCInternal.h

    r12644 r12880  
    196196    /** Indicates whether or we're ready for input. */
    197197    bool                fReady;
    198 
    199198    /** Scratch buffer position. */
    200199    char               *pszScratch;
  • trunk/src/VBox/Debugger/DBGCTcp.cpp

    r9269 r12880  
    169169}
    170170
     171/** @copydoc FNDBGCBACKSETREADY */
     172static DECLCALLBACK(void) dbgcTcpBackSetReady(PDBGCBACK pBack, bool fBusy)
     173{
     174    /* stub */
     175    NOREF(pBack);
     176    NOREF(fBusy);
     177}
     178
    171179
    172180/**
     
    188196     */
    189197    DBGCTCP    DbgcTcp;
    190     DbgcTcp.Back.pfnInput = dbgcTcpBackInput;
    191     DbgcTcp.Back.pfnRead  = dbgcTcpBackRead;
    192     DbgcTcp.Back.pfnWrite = dbgcTcpBackWrite;
     198    DbgcTcp.Back.pfnInput    = dbgcTcpBackInput;
     199    DbgcTcp.Back.pfnRead     = dbgcTcpBackRead;
     200    DbgcTcp.Back.pfnWrite    = dbgcTcpBackWrite;
     201    DbgcTcp.Back.pfnSetReady = dbgcTcpBackSetReady;
    193202    DbgcTcp.fAlive = true;
    194203    DbgcTcp.Sock   = Sock;
  • trunk/src/VBox/Debugger/DBGConsole.cpp

    r12878 r12880  
    16051605     */
    16061606    int rc = dbgcInputRead(pDbgc);
    1607     if (VBOX_FAILURE(rc))
     1607    if (RT_FAILURE(rc))
    16081608        return rc;
    16091609
     
    16131613    if (pDbgc->cInputLines)
    16141614    {
    1615         /** @todo this fReady stuff is broken. */
     1615        pDbgc->pBack->pfnSetReady(pDbgc->pBack, false);
    16161616        pDbgc->fReady = false;
    16171617        rc = dbgcProcessCommands(pDbgc, fNoExecute);
    1618         if (VBOX_SUCCESS(rc) && rc != VWRN_DBGC_CMD_PENDING)
     1618        if (RT_SUCCESS(rc) && rc != VWRN_DBGC_CMD_PENDING)
    16191619            pDbgc->fReady = true;
    1620         if (    VBOX_SUCCESS(rc)
     1620
     1621        if (    RT_SUCCESS(rc)
    16211622            &&  pDbgc->iRead == pDbgc->iWrite
    16221623            &&  pDbgc->fReady)
    16231624            rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "VBoxDbg> ");
     1625
     1626        if (    RT_SUCCESS(rc)
     1627            &&  pDbgc->fReady)
     1628            pDbgc->pBack->pfnSetReady(pDbgc->pBack, true);
    16241629    }
    16251630    else
     
    17961801        {
    17971802            rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf/dbgc error: Invalid command event!\n");
    1798             fPrintPrompt = !pDbgc->fReady;
    17991803            break;
    18001804        }
     
    18021806        case DBGFEVENT_TERMINATING:
    18031807        {
     1808            pDbgc->fReady = false;
     1809            pDbgc->pBack->pfnSetReady(pDbgc->pBack, false);
    18041810            pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\nVM is terminating!\n");
     1811            fPrintPrompt = false;
    18051812            rc = VERR_GENERAL_FAILURE;
    18061813            break;
     
    18111818        {
    18121819            rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf/dbgc error: Unknown event %d!\n", pEvent->enmType);
    1813             fPrintPrompt = !pDbgc->fReady;
    18141820            break;
    18151821        }
     
    18221828    {
    18231829        rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "VBoxDbg> ");
     1830        pDbgc->fReady = true;
     1831        if (RT_SUCCESS(rc))
     1832            pDbgc->pBack->pfnSetReady(pDbgc->pBack, true);
    18241833    }
    18251834
  • trunk/src/VBox/Debugger/VBoxDbgConsole.cpp

    r12878 r12880  
    276276
    277277VBoxDbgConsole::VBoxDbgConsole(PVM pVM, QWidget *pParent/* = NULL*/, const char *pszName/* = NULL*/)
    278     : VBoxDbgBase(pVM), m_pOutput(NULL), m_pInput(NULL),
    279     m_fInputNeedsEnabling(false), m_fInputRestoreFocus(false),
     278    : VBoxDbgBase(pVM), m_pOutput(NULL), m_pInput(NULL), m_fInputRestoreFocus(false),
    280279    m_pszInputBuf(NULL), m_cbInputBuf(0), m_cbInputBufAlloc(0),
    281280    m_pszOutputBuf(NULL), m_cbOutputBuf(0), m_cbOutputBufAlloc(0),
     
    380379     * Init the backend structure.
    381380     */
    382     m_Back.Core.pfnInput = backInput;
    383     m_Back.Core.pfnRead  = backRead;
    384     m_Back.Core.pfnWrite = backWrite;
     381    m_Back.Core.pfnInput   = backInput;
     382    m_Back.Core.pfnRead    = backRead;
     383    m_Back.Core.pfnWrite   = backWrite;
     384    m_Back.Core.pfnSetReady = backSetReady;
    385385    m_Back.pSelf = this;
    386386
     
    506506
    507507    m_fInputRestoreFocus = m_pInput->hasFocus();    /* dirty focus hack */
    508     m_fInputNeedsEnabling = true;
    509508    m_pInput->setEnabled(false);
    510509
     
    568567    if (!pThis->m_cbInputBuf)
    569568    {
    570         /*
    571          * Questing for input and not finding any means it's done processing
    572          * any commands that we've queued. Re-enable the input field if required.
    573          */
    574         if (pThis->m_fInputNeedsEnabling)
    575         {
    576             pThis->m_fInputNeedsEnabling = false;
    577             QApplication::postEvent(pThis, new VBoxDbgConsoleEvent(VBoxDbgConsoleEvent::kInputEnable));
    578         }
    579 
    580569        /*
    581570         * Wait outside the lock for the requested time, then check again.
     
    693682
    694683
     684/*static*/ DECLCALLBACK(void)
     685VBoxDbgConsole::backSetReady(PDBGCBACK pBack, bool fReady)
     686{
     687    VBoxDbgConsole *pThis = VBOXDBGCONSOLE_FROM_DBGCBACK(pBack);
     688    if (fReady)
     689        QApplication::postEvent(pThis, new VBoxDbgConsoleEvent(VBoxDbgConsoleEvent::kInputEnable));
     690}
     691
     692
    695693/**
    696694 * The Debugger Console Thread
  • trunk/src/VBox/Debugger/VBoxDbgConsole.h

    r12878 r12880  
    239239
    240240    /**
     241     * @copydoc FNDBGCBACKSETREADY
     242     */
     243    static DECLCALLBACK(void) backSetReady(PDBGCBACK pBack, bool fReady);
     244
     245    /**
    241246     * The Debugger Console Thread
    242247     *
     
    264269    /** The input widget. */
    265270    VBoxDbgConsoleInput *m_pInput;
    266     /** Whether we should send the kInputEnable event or not. */
    267     bool m_fInputNeedsEnabling;
    268271    /** A hack to restore focus to the combobox after a command execution. */
    269272    bool m_fInputRestoreFocus;
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