debugger: rename 'stop/quit' to exitDebugger

This commit is contained in:
hjk
2010-11-08 17:43:31 +01:00
parent 033a3aba9b
commit a181b45d28
6 changed files with 29 additions and 22 deletions

View File

@@ -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(); d->queueShutdownInferior();
} }

View File

@@ -199,6 +199,7 @@ public:
protected: protected:
friend class DebuggerPluginPrivate; friend class DebuggerPluginPrivate;
virtual void detachDebugger(); virtual void detachDebugger();
virtual void exitDebugger();
virtual void executeStep(); virtual void executeStep();
virtual void executeStepOut() ; virtual void executeStepOut() ;
virtual void executeNext(); virtual void executeNext();
@@ -208,8 +209,6 @@ protected:
virtual void continueInferior(); virtual void continueInferior();
virtual void interruptInferior(); virtual void interruptInferior();
virtual void exitInferior();
virtual void requestInterruptInferior(); virtual void requestInterruptInferior();
virtual void executeRunToLine(const QString &fileName, int lineNumber); virtual void executeRunToLine(const QString &fileName, int lineNumber);

View File

@@ -833,7 +833,7 @@ static bool isDebuggable(Core::IEditor *editor)
struct DebuggerActions struct DebuggerActions
{ {
QAction *continueAction; 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 *interruptAction; // on the fat debug button if "Pause" is possible
QAction *undisturbableAction; // on the fat debug button if nothing can be done QAction *undisturbableAction; // on the fat debug button if nothing can be done
QAction *resetAction; // FIXME: Should not be needed in a stable release QAction *resetAction; // FIXME: Should not be needed in a stable release
@@ -1153,7 +1153,7 @@ public slots:
void handleExecExit() void handleExecExit()
{ {
currentEngine()->exitInferior(); currentEngine()->exitDebugger();
} }
void handleFrameDown() void handleFrameDown()
@@ -1207,7 +1207,7 @@ public:
QToolButton *m_reverseToolButton; QToolButton *m_reverseToolButton;
QIcon m_startIcon; QIcon m_startIcon;
QIcon m_stopIcon; QIcon m_exitIcon;
QIcon m_continueIcon; QIcon m_continueIcon;
QIcon m_interruptIcon; QIcon m_interruptIcon;
QIcon m_locationMarkIcon; 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 = QIcon(_(":/debugger/images/debugger_start_small.png"));
m_startIcon.addFile(__(":/debugger/images/debugger_start.png")); m_startIcon.addFile(__(":/debugger/images/debugger_start.png"));
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png")); m_exitIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
m_stopIcon.addFile(__(":/debugger/images/debugger_stop.png")); m_exitIcon.addFile(__(":/debugger/images/debugger_stop.png"));
m_continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png")); m_continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png"));
m_continueIcon.addFile(__(":/debugger/images/debugger_continue.png")); m_continueIcon.addFile(__(":/debugger/images/debugger_continue.png"));
m_interruptIcon = QIcon(_(":/debugger/images/debugger_interrupt_small.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); act->setIcon(m_continueIcon);
connect(act, SIGNAL(triggered()), SLOT(handleExecContinue())); connect(act, SIGNAL(triggered()), SLOT(handleExecContinue()));
act = m_actions.stopAction = new QAction(tr("Stop Debugger"), this); act = m_actions.exitAction = new QAction(tr("Exit Debugger"), this);
act->setIcon(m_stopIcon); act->setIcon(m_exitIcon);
connect(act, SIGNAL(triggered()), SLOT(handleExecExit())); connect(act, SIGNAL(triggered()), SLOT(handleExecExit()));
act = m_actions.interruptAction = new QAction(tr("Interrupt"), this); 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); cmd->setAttribute(Command::CA_Hide);
m_uiSwitcher->addMenuAction(cmd, AnyLanguage, CC::G_DEFAULT_ONE); m_uiSwitcher->addMenuAction(cmd, AnyLanguage, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_actions.stopAction, cmd = am->registerAction(m_actions.exitAction,
Constants::STOP, globalcontext); Constants::STOP, globalcontext);
//cmd->setDefaultKeySequence(QKeySequence(Constants::STOP_KEY)); //cmd->setDefaultKeySequence(QKeySequence(Constants::STOP_KEY));
cmd->setDefaultText(tr("Stop Debugger")); cmd->setDefaultText(tr("Stop Debugger"));
@@ -2530,7 +2530,7 @@ void DebuggerPluginPrivate::setInitialState()
//m_actions.snapshotAction->setEnabled(false); //m_actions.snapshotAction->setEnabled(false);
theDebuggerAction(OperateByInstruction)->setEnabled(false); theDebuggerAction(OperateByInstruction)->setEnabled(false);
m_actions.stopAction->setEnabled(false); m_actions.exitAction->setEnabled(false);
m_actions.resetAction->setEnabled(false); m_actions.resetAction->setEnabled(false);
m_actions.stepAction->setEnabled(false); m_actions.stepAction->setEnabled(false);
@@ -2581,7 +2581,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// F5 starts debugging. It is "startable". // F5 starts debugging. It is "startable".
m_actions.interruptAction->setEnabled(false); m_actions.interruptAction->setEnabled(false);
m_actions.continueAction->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(Constants::STOP)->setKeySequence(QKeySequence());
am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY));
core->updateAdditionalContexts(m_anyContext, Context()); core->updateAdditionalContexts(m_anyContext, Context());
@@ -2589,7 +2589,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// F5 continues, Shift-F5 kills. It is "continuable". // F5 continues, Shift-F5 kills. It is "continuable".
m_actions.interruptAction->setEnabled(false); m_actions.interruptAction->setEnabled(false);
m_actions.continueAction->setEnabled(true); 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(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY));
am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY));
core->updateAdditionalContexts(m_anyContext, m_continuableContext); core->updateAdditionalContexts(m_anyContext, m_continuableContext);
@@ -2597,7 +2597,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// Shift-F5 interrupts. It is also "interruptible". // Shift-F5 interrupts. It is also "interruptible".
m_actions.interruptAction->setEnabled(true); m_actions.interruptAction->setEnabled(true);
m_actions.continueAction->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(Constants::STOP)->setKeySequence(QKeySequence());
am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY));
core->updateAdditionalContexts(m_anyContext, m_interruptibleContext); core->updateAdditionalContexts(m_anyContext, m_interruptibleContext);
@@ -2605,7 +2605,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// We don't want to do anything anymore. // We don't want to do anything anymore.
m_actions.interruptAction->setEnabled(false); m_actions.interruptAction->setEnabled(false);
m_actions.continueAction->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(Constants::STOP)->setKeySequence(QKeySequence());
am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY));
//core->updateAdditionalContexts(m_anyContext, m_finishedContext); //core->updateAdditionalContexts(m_anyContext, m_finishedContext);
@@ -2617,7 +2617,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// We don't want to do anything anymore. // We don't want to do anything anymore.
m_actions.interruptAction->setEnabled(false); m_actions.interruptAction->setEnabled(false);
m_actions.continueAction->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(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY));
am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY));
core->updateAdditionalContexts(m_anyContext, m_finishedContext); core->updateAdditionalContexts(m_anyContext, m_finishedContext);
@@ -2625,7 +2625,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
// Everything else is "undisturbable". // Everything else is "undisturbable".
m_actions.interruptAction->setEnabled(false); m_actions.interruptAction->setEnabled(false);
m_actions.continueAction->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(Constants::STOP)->setKeySequence(QKeySequence());
am->command(PE::DEBUG)->setKeySequence(QKeySequence()); am->command(PE::DEBUG)->setKeySequence(QKeySequence());
core->updateAdditionalContexts(m_anyContext, m_undisturbableContext); core->updateAdditionalContexts(m_anyContext, m_undisturbableContext);

View File

@@ -234,7 +234,7 @@ void SnapshotHandler::removeSnapshot(int index)
setState(EngineSetupRequested); setState(EngineSetupRequested);
postCommand("set stack-cache off"); postCommand("set stack-cache off");
#endif #endif
QString fileName = engine->startParameters().coreFile; //QString fileName = engine->startParameters().coreFile;
//if (!fileName.isEmpty()) //if (!fileName.isEmpty())
// QFile::remove(fileName); // QFile::remove(fileName);
m_snapshots.removeAt(index); m_snapshots.removeAt(index);
@@ -242,7 +242,7 @@ void SnapshotHandler::removeSnapshot(int index)
m_currentIndex = -1; m_currentIndex = -1;
else if (index < m_currentIndex) else if (index < m_currentIndex)
--m_currentIndex; --m_currentIndex;
engine->quitDebugger(); //engine->quitDebugger();
reset(); reset();
} }

View File

@@ -32,6 +32,7 @@
#include "debuggeractions.h" #include "debuggeractions.h"
#include "debuggerconstants.h" #include "debuggerconstants.h"
#include "debuggerrunner.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
@@ -96,7 +97,7 @@ void SnapshotWindow::keyPressEvent(QKeyEvent *ev)
if (si.isEmpty()) if (si.isEmpty())
si.append(currentIndex().sibling(currentIndex().row(), 0)); si.append(currentIndex().sibling(currentIndex().row(), 0));
foreach (const QModelIndex &idx, normalizeIndexes(si)) foreach (const QModelIndex &idx, normalizeIndexes(si))
m_snapshotHandler->removeSnapshot(idx.row()); removeSnapshot(idx.row());
} }
QTreeView::keyPressEvent(ev); QTreeView::keyPressEvent(ev);
} }
@@ -133,13 +134,18 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actCreate) if (act == actCreate)
m_snapshotHandler->createSnapshot(idx.row()); m_snapshotHandler->createSnapshot(idx.row());
else if (act == actRemove) else if (act == actRemove)
m_snapshotHandler->removeSnapshot(idx.row()); removeSnapshot(idx.row());
else if (act == actAdjust) else if (act == actAdjust)
resizeColumnsToContents(); resizeColumnsToContents();
else if (act == actAlwaysAdjust) else if (act == actAlwaysAdjust)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents); setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
} }
void SnapshotWindow::removeSnapshot(int i)
{
m_snapshotHandler->at(i)->stop();
}
void SnapshotWindow::resizeColumnsToContents() void SnapshotWindow::resizeColumnsToContents()
{ {
for (int i = model()->columnCount(); --i >= 0; ) for (int i = model()->columnCount(); --i >= 0; )

View File

@@ -53,6 +53,7 @@ private slots:
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); } void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
private: private:
void removeSnapshot(int i);
void keyPressEvent(QKeyEvent *ev); void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev); void contextMenuEvent(QContextMenuEvent *ev);