Realign stack pointer (#987)
This commit is contained in:
parent
e6b831e631
commit
6c44c18c00
|
@ -81,6 +81,10 @@ void CPUStack::setupContextMenu()
|
||||||
mPopAction = new QAction(ArchValue(tr("P&op DWORD"), tr("P&op QWORD")), this);
|
mPopAction = new QAction(ArchValue(tr("P&op DWORD"), tr("P&op QWORD")), this);
|
||||||
connect(mPopAction, SIGNAL(triggered()), this, SLOT(popSlot()));
|
connect(mPopAction, SIGNAL(triggered()), this, SLOT(popSlot()));
|
||||||
|
|
||||||
|
//Realign
|
||||||
|
mRealignAction = new QAction(tr("Align Stack Pointer"), this);
|
||||||
|
connect(mRealignAction, SIGNAL(triggered()), this, SLOT(realignSlot()));
|
||||||
|
|
||||||
//Binary menu
|
//Binary menu
|
||||||
mBinaryMenu = new QMenu(tr("B&inary"), this);
|
mBinaryMenu = new QMenu(tr("B&inary"), this);
|
||||||
mBinaryMenu->setIcon(DIcon("binary.png"));
|
mBinaryMenu->setIcon(DIcon("binary.png"));
|
||||||
|
@ -519,6 +523,12 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
|
||||||
QMenu wMenu(this); //create context menu
|
QMenu wMenu(this); //create context menu
|
||||||
wMenu.addAction(mPushAction);
|
wMenu.addAction(mPushAction);
|
||||||
wMenu.addAction(mPopAction);
|
wMenu.addAction(mPopAction);
|
||||||
|
#ifdef _WIN64
|
||||||
|
if((mCsp & 0x7) != 0)
|
||||||
|
#else //x86
|
||||||
|
if((mCsp & 0x3) != 0)
|
||||||
|
#endif //_WIN64
|
||||||
|
wMenu.addAction(mRealignAction);
|
||||||
wMenu.addAction(mModifyAction);
|
wMenu.addAction(mModifyAction);
|
||||||
wMenu.addMenu(mBinaryMenu);
|
wMenu.addMenu(mBinaryMenu);
|
||||||
QMenu wCopyMenu(tr("&Copy"), this);
|
QMenu wCopyMenu(tr("&Copy"), this);
|
||||||
|
@ -1068,6 +1078,17 @@ void CPUStack::popSlot()
|
||||||
GuiUpdateAllViews();
|
GuiUpdateAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPUStack::realignSlot()
|
||||||
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
|
mCsp &= ~0x7;
|
||||||
|
#else //x86
|
||||||
|
mCsp &= ~0x3;
|
||||||
|
#endif //_WIN64
|
||||||
|
DbgValToString("csp", mCsp);
|
||||||
|
GuiUpdateAllViews();
|
||||||
|
}
|
||||||
|
|
||||||
void CPUStack::freezeStackSlot()
|
void CPUStack::freezeStackSlot()
|
||||||
{
|
{
|
||||||
if(bStackFrozen)
|
if(bStackFrozen)
|
||||||
|
|
|
@ -70,6 +70,7 @@ public slots:
|
||||||
void binaryPasteIgnoreSizeSlot();
|
void binaryPasteIgnoreSizeSlot();
|
||||||
void undoSelectionSlot();
|
void undoSelectionSlot();
|
||||||
void modifySlot();
|
void modifySlot();
|
||||||
|
void realignSlot();
|
||||||
void freezeStackSlot();
|
void freezeStackSlot();
|
||||||
void dbgStateChangedSlot(DBGSTATE state);
|
void dbgStateChangedSlot(DBGSTATE state);
|
||||||
|
|
||||||
|
@ -126,6 +127,7 @@ private:
|
||||||
QMenu* mFollowInDumpMenu;
|
QMenu* mFollowInDumpMenu;
|
||||||
QAction* mPushAction;
|
QAction* mPushAction;
|
||||||
QAction* mPopAction;
|
QAction* mPopAction;
|
||||||
|
QAction* mRealignAction;
|
||||||
QList<QAction*> mFollowInDumpActions;
|
QList<QAction*> mFollowInDumpActions;
|
||||||
|
|
||||||
GotoDialog* mGoto;
|
GotoDialog* mGoto;
|
||||||
|
|
Loading…
Reference in New Issue