- Timestamp:
- Oct 1, 2008 9:45:19 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dbg.h
r12653 r12880 644 644 typedef FNDBGCBACKWRITE *PFNDBGCBACKWRITE; 645 645 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 */ 654 typedef DECLCALLBACK(void) FNDBGCBACKSETREADY(PDBGCBACK pBack, bool fReady); 655 /** Pointer to a FNDBGCBACKSETREADY() callback. */ 656 typedef FNDBGCBACKSETREADY *PFNDBGCBACKSETREADY; 657 646 658 647 659 /** … … 657 669 /** Write output. */ 658 670 PFNDBGCBACKWRITE pfnWrite; 671 /** Ready / busy notification. */ 672 PFNDBGCBACKSETREADY pfnSetReady; 659 673 } DBGCBACK; 660 674 -
trunk/src/VBox/Debugger/DBGCInternal.h
r12644 r12880 196 196 /** Indicates whether or we're ready for input. */ 197 197 bool fReady; 198 199 198 /** Scratch buffer position. */ 200 199 char *pszScratch; -
trunk/src/VBox/Debugger/DBGCTcp.cpp
r9269 r12880 169 169 } 170 170 171 /** @copydoc FNDBGCBACKSETREADY */ 172 static DECLCALLBACK(void) dbgcTcpBackSetReady(PDBGCBACK pBack, bool fBusy) 173 { 174 /* stub */ 175 NOREF(pBack); 176 NOREF(fBusy); 177 } 178 171 179 172 180 /** … … 188 196 */ 189 197 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; 193 202 DbgcTcp.fAlive = true; 194 203 DbgcTcp.Sock = Sock; -
trunk/src/VBox/Debugger/DBGConsole.cpp
r12878 r12880 1605 1605 */ 1606 1606 int rc = dbgcInputRead(pDbgc); 1607 if ( VBOX_FAILURE(rc))1607 if (RT_FAILURE(rc)) 1608 1608 return rc; 1609 1609 … … 1613 1613 if (pDbgc->cInputLines) 1614 1614 { 1615 /** @todo this fReady stuff is broken. */1615 pDbgc->pBack->pfnSetReady(pDbgc->pBack, false); 1616 1616 pDbgc->fReady = false; 1617 1617 rc = dbgcProcessCommands(pDbgc, fNoExecute); 1618 if ( VBOX_SUCCESS(rc) && rc != VWRN_DBGC_CMD_PENDING)1618 if (RT_SUCCESS(rc) && rc != VWRN_DBGC_CMD_PENDING) 1619 1619 pDbgc->fReady = true; 1620 if ( VBOX_SUCCESS(rc) 1620 1621 if ( RT_SUCCESS(rc) 1621 1622 && pDbgc->iRead == pDbgc->iWrite 1622 1623 && pDbgc->fReady) 1623 1624 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "VBoxDbg> "); 1625 1626 if ( RT_SUCCESS(rc) 1627 && pDbgc->fReady) 1628 pDbgc->pBack->pfnSetReady(pDbgc->pBack, true); 1624 1629 } 1625 1630 else … … 1796 1801 { 1797 1802 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf/dbgc error: Invalid command event!\n"); 1798 fPrintPrompt = !pDbgc->fReady;1799 1803 break; 1800 1804 } … … 1802 1806 case DBGFEVENT_TERMINATING: 1803 1807 { 1808 pDbgc->fReady = false; 1809 pDbgc->pBack->pfnSetReady(pDbgc->pBack, false); 1804 1810 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\nVM is terminating!\n"); 1811 fPrintPrompt = false; 1805 1812 rc = VERR_GENERAL_FAILURE; 1806 1813 break; … … 1811 1818 { 1812 1819 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf/dbgc error: Unknown event %d!\n", pEvent->enmType); 1813 fPrintPrompt = !pDbgc->fReady;1814 1820 break; 1815 1821 } … … 1822 1828 { 1823 1829 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "VBoxDbg> "); 1830 pDbgc->fReady = true; 1831 if (RT_SUCCESS(rc)) 1832 pDbgc->pBack->pfnSetReady(pDbgc->pBack, true); 1824 1833 } 1825 1834 -
trunk/src/VBox/Debugger/VBoxDbgConsole.cpp
r12878 r12880 276 276 277 277 VBoxDbgConsole::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), 280 279 m_pszInputBuf(NULL), m_cbInputBuf(0), m_cbInputBufAlloc(0), 281 280 m_pszOutputBuf(NULL), m_cbOutputBuf(0), m_cbOutputBufAlloc(0), … … 380 379 * Init the backend structure. 381 380 */ 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; 385 385 m_Back.pSelf = this; 386 386 … … 506 506 507 507 m_fInputRestoreFocus = m_pInput->hasFocus(); /* dirty focus hack */ 508 m_fInputNeedsEnabling = true;509 508 m_pInput->setEnabled(false); 510 509 … … 568 567 if (!pThis->m_cbInputBuf) 569 568 { 570 /*571 * Questing for input and not finding any means it's done processing572 * 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 580 569 /* 581 570 * Wait outside the lock for the requested time, then check again. … … 693 682 694 683 684 /*static*/ DECLCALLBACK(void) 685 VBoxDbgConsole::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 695 693 /** 696 694 * The Debugger Console Thread -
trunk/src/VBox/Debugger/VBoxDbgConsole.h
r12878 r12880 239 239 240 240 /** 241 * @copydoc FNDBGCBACKSETREADY 242 */ 243 static DECLCALLBACK(void) backSetReady(PDBGCBACK pBack, bool fReady); 244 245 /** 241 246 * The Debugger Console Thread 242 247 * … … 264 269 /** The input widget. */ 265 270 VBoxDbgConsoleInput *m_pInput; 266 /** Whether we should send the kInputEnable event or not. */267 bool m_fInputNeedsEnabling;268 271 /** A hack to restore focus to the combobox after a command execution. */ 269 272 bool m_fInputRestoreFocus;
Note:
See TracChangeset
for help on using the changeset viewer.