1
0
Fork 0

Realign stack pointer (#987)

This commit is contained in:
Torusrxxx 2016-08-17 14:34:34 +00:00 committed by Duncan Ogilvie
parent e6b831e631
commit 6c44c18c00
2 changed files with 23 additions and 0 deletions

View File

@ -81,6 +81,10 @@ void CPUStack::setupContextMenu()
mPopAction = new QAction(ArchValue(tr("P&op DWORD"), tr("P&op QWORD")), this);
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
mBinaryMenu = new QMenu(tr("B&inary"), this);
mBinaryMenu->setIcon(DIcon("binary.png"));
@ -519,6 +523,12 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
QMenu wMenu(this); //create context menu
wMenu.addAction(mPushAction);
wMenu.addAction(mPopAction);
#ifdef _WIN64
if((mCsp & 0x7) != 0)
#else //x86
if((mCsp & 0x3) != 0)
#endif //_WIN64
wMenu.addAction(mRealignAction);
wMenu.addAction(mModifyAction);
wMenu.addMenu(mBinaryMenu);
QMenu wCopyMenu(tr("&Copy"), this);
@ -1068,6 +1078,17 @@ void CPUStack::popSlot()
GuiUpdateAllViews();
}
void CPUStack::realignSlot()
{
#ifdef _WIN64
mCsp &= ~0x7;
#else //x86
mCsp &= ~0x3;
#endif //_WIN64
DbgValToString("csp", mCsp);
GuiUpdateAllViews();
}
void CPUStack::freezeStackSlot()
{
if(bStackFrozen)

View File

@ -70,6 +70,7 @@ public slots:
void binaryPasteIgnoreSizeSlot();
void undoSelectionSlot();
void modifySlot();
void realignSlot();
void freezeStackSlot();
void dbgStateChangedSlot(DBGSTATE state);
@ -126,6 +127,7 @@ private:
QMenu* mFollowInDumpMenu;
QAction* mPushAction;
QAction* mPopAction;
QAction* mRealignAction;
QList<QAction*> mFollowInDumpActions;
GotoDialog* mGoto;