From: hjk Date: Mon, 8 Nov 2010 16:43:31 +0000 (+0100) Subject: debugger: rename 'stop/quit' to exitDebugger X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a181b45d28a5477733f8a09f7295aceba1ad1760;p=qt-creator-jp%2Fqt-creator-jp.git debugger: rename 'stop/quit' to exitDebugger --- diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index bd76dd128c..927a2c5bae 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1240,8 +1240,9 @@ void DebuggerEngine::detachDebugger() { } -void DebuggerEngine::exitInferior() +void DebuggerEngine::exitDebugger() { + QTC_ASSERT(d->m_state == InferiorStopOk, qDebug() << d->m_state); d->queueShutdownInferior(); } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index c5d2fcbab5..934c764103 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -199,6 +199,7 @@ public: protected: friend class DebuggerPluginPrivate; virtual void detachDebugger(); + virtual void exitDebugger(); virtual void executeStep(); virtual void executeStepOut() ; virtual void executeNext(); @@ -208,8 +209,6 @@ protected: virtual void continueInferior(); virtual void interruptInferior(); - virtual void exitInferior(); - virtual void requestInterruptInferior(); virtual void executeRunToLine(const QString &fileName, int lineNumber); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 96715d2e65..149f2e37f3 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -833,7 +833,7 @@ static bool isDebuggable(Core::IEditor *editor) struct DebuggerActions { QAction *continueAction; - QAction *stopAction; // on the application output button if "Stop" is possible + QAction *exitAction; // on the application output button if "Stop" is possible QAction *interruptAction; // on the fat debug button if "Pause" is possible QAction *undisturbableAction; // on the fat debug button if nothing can be done QAction *resetAction; // FIXME: Should not be needed in a stable release @@ -1153,7 +1153,7 @@ public slots: void handleExecExit() { - currentEngine()->exitInferior(); + currentEngine()->exitDebugger(); } void handleFrameDown() @@ -1207,7 +1207,7 @@ public: QToolButton *m_reverseToolButton; QIcon m_startIcon; - QIcon m_stopIcon; + QIcon m_exitIcon; QIcon m_continueIcon; QIcon m_interruptIcon; QIcon m_locationMarkIcon; @@ -1330,8 +1330,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er m_startIcon = QIcon(_(":/debugger/images/debugger_start_small.png")); m_startIcon.addFile(__(":/debugger/images/debugger_start.png")); - m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png")); - m_stopIcon.addFile(__(":/debugger/images/debugger_stop.png")); + m_exitIcon = QIcon(_(":/debugger/images/debugger_stop_small.png")); + m_exitIcon.addFile(__(":/debugger/images/debugger_stop.png")); m_continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png")); m_continueIcon.addFile(__(":/debugger/images/debugger_continue.png")); m_interruptIcon = QIcon(_(":/debugger/images/debugger_interrupt_small.png")); @@ -1396,8 +1396,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er act->setIcon(m_continueIcon); connect(act, SIGNAL(triggered()), SLOT(handleExecContinue())); - act = m_actions.stopAction = new QAction(tr("Stop Debugger"), this); - act->setIcon(m_stopIcon); + act = m_actions.exitAction = new QAction(tr("Exit Debugger"), this); + act->setIcon(m_exitIcon); connect(act, SIGNAL(triggered()), SLOT(handleExecExit())); act = m_actions.interruptAction = new QAction(tr("Interrupt"), this); @@ -1630,7 +1630,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er cmd->setAttribute(Command::CA_Hide); m_uiSwitcher->addMenuAction(cmd, AnyLanguage, CC::G_DEFAULT_ONE); - cmd = am->registerAction(m_actions.stopAction, + cmd = am->registerAction(m_actions.exitAction, Constants::STOP, globalcontext); //cmd->setDefaultKeySequence(QKeySequence(Constants::STOP_KEY)); cmd->setDefaultText(tr("Stop Debugger")); @@ -2530,7 +2530,7 @@ void DebuggerPluginPrivate::setInitialState() //m_actions.snapshotAction->setEnabled(false); theDebuggerAction(OperateByInstruction)->setEnabled(false); - m_actions.stopAction->setEnabled(false); + m_actions.exitAction->setEnabled(false); m_actions.resetAction->setEnabled(false); m_actions.stepAction->setEnabled(false); @@ -2581,7 +2581,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // F5 starts debugging. It is "startable". m_actions.interruptAction->setEnabled(false); m_actions.continueAction->setEnabled(false); - m_actions.stopAction->setEnabled(false); + m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); core->updateAdditionalContexts(m_anyContext, Context()); @@ -2589,7 +2589,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // F5 continues, Shift-F5 kills. It is "continuable". m_actions.interruptAction->setEnabled(false); m_actions.continueAction->setEnabled(true); - m_actions.stopAction->setEnabled(true); + m_actions.exitAction->setEnabled(true); am->command(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); core->updateAdditionalContexts(m_anyContext, m_continuableContext); @@ -2597,7 +2597,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // Shift-F5 interrupts. It is also "interruptible". m_actions.interruptAction->setEnabled(true); m_actions.continueAction->setEnabled(false); - m_actions.stopAction->setEnabled(false); + m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); core->updateAdditionalContexts(m_anyContext, m_interruptibleContext); @@ -2605,7 +2605,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // We don't want to do anything anymore. m_actions.interruptAction->setEnabled(false); m_actions.continueAction->setEnabled(false); - m_actions.stopAction->setEnabled(false); + m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); //core->updateAdditionalContexts(m_anyContext, m_finishedContext); @@ -2617,7 +2617,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // We don't want to do anything anymore. m_actions.interruptAction->setEnabled(false); m_actions.continueAction->setEnabled(false); - m_actions.stopAction->setEnabled(true); + m_actions.exitAction->setEnabled(true); am->command(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); core->updateAdditionalContexts(m_anyContext, m_finishedContext); @@ -2625,7 +2625,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) // Everything else is "undisturbable". m_actions.interruptAction->setEnabled(false); m_actions.continueAction->setEnabled(false); - m_actions.stopAction->setEnabled(false); + m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); am->command(PE::DEBUG)->setKeySequence(QKeySequence()); core->updateAdditionalContexts(m_anyContext, m_undisturbableContext); diff --git a/src/plugins/debugger/snapshothandler.cpp b/src/plugins/debugger/snapshothandler.cpp index a65c05b0dc..98ddf14234 100644 --- a/src/plugins/debugger/snapshothandler.cpp +++ b/src/plugins/debugger/snapshothandler.cpp @@ -234,7 +234,7 @@ void SnapshotHandler::removeSnapshot(int index) setState(EngineSetupRequested); postCommand("set stack-cache off"); #endif - QString fileName = engine->startParameters().coreFile; + //QString fileName = engine->startParameters().coreFile; //if (!fileName.isEmpty()) // QFile::remove(fileName); m_snapshots.removeAt(index); @@ -242,7 +242,7 @@ void SnapshotHandler::removeSnapshot(int index) m_currentIndex = -1; else if (index < m_currentIndex) --m_currentIndex; - engine->quitDebugger(); + //engine->quitDebugger(); reset(); } diff --git a/src/plugins/debugger/snapshotwindow.cpp b/src/plugins/debugger/snapshotwindow.cpp index 5c86013f2b..74b534e4e5 100644 --- a/src/plugins/debugger/snapshotwindow.cpp +++ b/src/plugins/debugger/snapshotwindow.cpp @@ -32,6 +32,7 @@ #include "debuggeractions.h" #include "debuggerconstants.h" +#include "debuggerrunner.h" #include #include @@ -96,7 +97,7 @@ void SnapshotWindow::keyPressEvent(QKeyEvent *ev) if (si.isEmpty()) si.append(currentIndex().sibling(currentIndex().row(), 0)); foreach (const QModelIndex &idx, normalizeIndexes(si)) - m_snapshotHandler->removeSnapshot(idx.row()); + removeSnapshot(idx.row()); } QTreeView::keyPressEvent(ev); } @@ -133,13 +134,18 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev) if (act == actCreate) m_snapshotHandler->createSnapshot(idx.row()); else if (act == actRemove) - m_snapshotHandler->removeSnapshot(idx.row()); + removeSnapshot(idx.row()); else if (act == actAdjust) resizeColumnsToContents(); else if (act == actAlwaysAdjust) setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents); } +void SnapshotWindow::removeSnapshot(int i) +{ + m_snapshotHandler->at(i)->stop(); +} + void SnapshotWindow::resizeColumnsToContents() { for (int i = model()->columnCount(); --i >= 0; ) diff --git a/src/plugins/debugger/snapshotwindow.h b/src/plugins/debugger/snapshotwindow.h index 42934e61ca..07939d77f1 100644 --- a/src/plugins/debugger/snapshotwindow.h +++ b/src/plugins/debugger/snapshotwindow.h @@ -53,6 +53,7 @@ private slots: void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); } private: + void removeSnapshot(int i); void keyPressEvent(QKeyEvent *ev); void contextMenuEvent(QContextMenuEvent *ev);