forked from qt-creator/qt-creator
debugger: create actions for 'Stack Up' and 'Stack Down'
There is no shortcut associated with these actions, the user has to set them up by himself.
This commit is contained in:
@@ -180,6 +180,8 @@ struct DebuggerManagerActions
|
||||
QAction *breakAction;
|
||||
QAction *sepAction;
|
||||
QAction *reverseDirectionAction;
|
||||
QAction *frameUpAction;
|
||||
QAction *frameDownAction;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -569,6 +569,12 @@ void DebuggerManager::init()
|
||||
d->m_actions.reverseDirectionAction->setIcon(
|
||||
QIcon(":/debugger/images/debugger_reversemode_16.png"));
|
||||
|
||||
d->m_actions.frameDownAction =
|
||||
new QAction(tr("Move to Called Frame"), this);
|
||||
d->m_actions.frameUpAction =
|
||||
new QAction(tr("Move to Calling Frame"), this);
|
||||
|
||||
d->m_actions.reverseDirectionAction->setCheckable(false);
|
||||
connect(d->m_actions.continueAction, SIGNAL(triggered()),
|
||||
this, SLOT(executeContinue()));
|
||||
connect(d->m_actions.stopAction, SIGNAL(triggered()),
|
||||
@@ -599,6 +605,10 @@ void DebuggerManager::init()
|
||||
this, SLOT(addToWatchWindow()));
|
||||
connect(d->m_actions.snapshotAction, SIGNAL(triggered()),
|
||||
this, SLOT(makeSnapshot()));
|
||||
connect(d->m_actions.frameDownAction, SIGNAL(triggered()),
|
||||
this, SLOT(frameDown()));
|
||||
connect(d->m_actions.frameUpAction, SIGNAL(triggered()),
|
||||
this, SLOT(frameUp()));
|
||||
|
||||
connect(d->m_statusTimer, SIGNAL(timeout()),
|
||||
this, SLOT(clearStatusMessage()));
|
||||
@@ -877,6 +887,20 @@ void DebuggerManager::aboutToShutdown()
|
||||
d->m_engine = 0;
|
||||
}
|
||||
|
||||
void DebuggerManager::frameUp()
|
||||
{
|
||||
QTC_ASSERT(d->m_engine, return);
|
||||
int currentIndex = stackHandler()->currentIndex();
|
||||
activateFrame(qMin(currentIndex + 1, stackHandler()->stackSize() - 1));
|
||||
}
|
||||
|
||||
void DebuggerManager::frameDown()
|
||||
{
|
||||
QTC_ASSERT(d->m_engine, return);
|
||||
int currentIndex = stackHandler()->currentIndex();
|
||||
activateFrame(qMax(currentIndex - 1, 0));
|
||||
}
|
||||
|
||||
void DebuggerManager::makeSnapshot()
|
||||
{
|
||||
QTC_ASSERT(d->m_engine, return);
|
||||
|
||||
@@ -241,6 +241,8 @@ public slots:
|
||||
void executeReturn();
|
||||
void detachDebugger();
|
||||
void makeSnapshot();
|
||||
void frameUp();
|
||||
void frameDown();
|
||||
|
||||
void addToWatchWindow();
|
||||
void updateWatchData(const Debugger::Internal::WatchData &data);
|
||||
|
||||
@@ -139,6 +139,8 @@ const char * const BREAK_AT_MAIN = "Debugger.BreakAtMain";
|
||||
const char * const ADD_TO_WATCH1 = "Debugger.AddToWatch1";
|
||||
const char * const ADD_TO_WATCH2 = "Debugger.AddToWatch2";
|
||||
const char * const OPERATE_BY_INSTRUCTION = "Debugger.OperateByInstruction";
|
||||
const char * const FRAME_UP = "Debugger.FrameUp";
|
||||
const char * const FRAME_DOWN = "Debugger.FrameDown";
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
const char * const INTERRUPT_KEY = "Shift+F5";
|
||||
@@ -894,6 +896,11 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
m_uiSwitcher->addMenuAction(cmd, Constants::LANG_CPP);
|
||||
|
||||
cmd = am->registerAction(actions.frameDownAction,
|
||||
Constants::FRAME_DOWN, cppDebuggercontext);
|
||||
cmd = am->registerAction(actions.frameUpAction,
|
||||
Constants::FRAME_UP, cppDebuggercontext);
|
||||
|
||||
|
||||
cmd = am->registerAction(theDebuggerAction(OperateByInstruction),
|
||||
Constants::OPERATE_BY_INSTRUCTION, cppDebuggercontext);
|
||||
|
||||
Reference in New Issue
Block a user