Merge pull request #547 from blaquee/stackview_dump_at
Stackview dump at Implementation
This commit is contained in:
commit
4626351c6a
|
@ -1,17 +1,20 @@
|
||||||
#include "CPUStack.h"
|
#include "CPUStack.h"
|
||||||
|
#include "CPUDump.h"
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Bridge.h"
|
#include "Bridge.h"
|
||||||
#include "HexEditDialog.h"
|
#include "HexEditDialog.h"
|
||||||
#include "WordEditDialog.h"
|
#include "WordEditDialog.h"
|
||||||
|
#include "CPUMultiDump.h"
|
||||||
|
|
||||||
CPUStack::CPUStack(QWidget* parent) : HexDump(parent)
|
CPUStack::CPUStack(CPUMultiDump* multiDump, QWidget* parent) : HexDump(parent)
|
||||||
{
|
{
|
||||||
setShowHeader(false);
|
setShowHeader(false);
|
||||||
int charwidth = getCharWidth();
|
int charwidth = getCharWidth();
|
||||||
ColumnDescriptor_t wColDesc;
|
ColumnDescriptor_t wColDesc;
|
||||||
DataDescriptor_t dDesc;
|
DataDescriptor_t dDesc;
|
||||||
bStackFrozen = false;
|
bStackFrozen = false;
|
||||||
|
mMultiDump = multiDump;
|
||||||
|
|
||||||
mForceColumn = 1;
|
mForceColumn = 1;
|
||||||
|
|
||||||
|
@ -153,6 +156,21 @@ void CPUStack::setupContextMenu()
|
||||||
mFollowDump = new QAction("Follow in &Dump", this);
|
mFollowDump = new QAction("Follow in &Dump", this);
|
||||||
connect(mFollowDump, SIGNAL(triggered()), this, SLOT(followDumpSlot()));
|
connect(mFollowDump, SIGNAL(triggered()), this, SLOT(followDumpSlot()));
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
mFollowInDumpMenu = new QMenu("&Follow QWORD in Dump", this);
|
||||||
|
#else //x86
|
||||||
|
mFollowInDumpMenu = new QMenu("&Follow DWORD in Dump", this);
|
||||||
|
#endif //_WIN64
|
||||||
|
|
||||||
|
int maxDumps = mMultiDump->getMaxCPUTabs();
|
||||||
|
for(int i = 0; i < maxDumps; i++)
|
||||||
|
{
|
||||||
|
QAction* action = new QAction(QString("Dump %1)").arg(i+1), this);
|
||||||
|
connect(action, SIGNAL(triggered()), this, SLOT(followinDumpNSlot()));
|
||||||
|
mFollowInDumpMenu->addAction(action);
|
||||||
|
mFollowInDumpActions.push_back(action);
|
||||||
|
}
|
||||||
|
|
||||||
mFollowStack = new QAction("Follow in &Stack", this);
|
mFollowStack = new QAction("Follow in &Stack", this);
|
||||||
connect(mFollowStack, SIGNAL(triggered()), this, SLOT(followStackSlot()));
|
connect(mFollowStack, SIGNAL(triggered()), this, SLOT(followStackSlot()));
|
||||||
|
|
||||||
|
@ -363,6 +381,7 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
|
||||||
else
|
else
|
||||||
wMenu->addAction(mFollowDisasm);
|
wMenu->addAction(mFollowDisasm);
|
||||||
wMenu->addAction(mFollowDump);
|
wMenu->addAction(mFollowDump);
|
||||||
|
wMenu->addMenu(mFollowInDumpMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
wMenu->addSeparator();
|
wMenu->addSeparator();
|
||||||
|
@ -490,6 +509,23 @@ void CPUStack::followDumpSlot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPUStack::followinDumpNSlot()
|
||||||
|
{
|
||||||
|
duint selectedData = rvaToVa(getInitialSelection());
|
||||||
|
|
||||||
|
if(DbgMemIsValidReadPtr(selectedData))
|
||||||
|
{
|
||||||
|
for(int i = 0; i < mFollowInDumpActions.length(); i++)
|
||||||
|
{
|
||||||
|
if(mFollowInDumpActions[i] == sender())
|
||||||
|
{
|
||||||
|
QString addrText = QString("%1").arg(ToPtrString(selectedData));
|
||||||
|
DbgCmdExec(QString("dump [%1], %2").arg(addrText.toUtf8().constData()).arg(i).toUtf8().constData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CPUStack::followStackSlot()
|
void CPUStack::followStackSlot()
|
||||||
{
|
{
|
||||||
duint selectedData;
|
duint selectedData;
|
||||||
|
|
|
@ -4,11 +4,14 @@
|
||||||
#include "HexDump.h"
|
#include "HexDump.h"
|
||||||
#include "GotoDialog.h"
|
#include "GotoDialog.h"
|
||||||
|
|
||||||
|
//forward declaration
|
||||||
|
class CPUMultiDump;
|
||||||
|
|
||||||
class CPUStack : public HexDump
|
class CPUStack : public HexDump
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CPUStack(QWidget* parent = 0);
|
explicit CPUStack(CPUMultiDump* multiDump, QWidget* parent = 0);
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
virtual void updateColors();
|
virtual void updateColors();
|
||||||
|
@ -33,6 +36,7 @@ public slots:
|
||||||
void selectionSet(const SELECTIONDATA* selection);
|
void selectionSet(const SELECTIONDATA* selection);
|
||||||
void followDisasmSlot();
|
void followDisasmSlot();
|
||||||
void followDumpSlot();
|
void followDumpSlot();
|
||||||
|
void followinDumpNSlot();
|
||||||
void followStackSlot();
|
void followStackSlot();
|
||||||
void binaryEditSlot();
|
void binaryEditSlot();
|
||||||
void binaryFillSlot();
|
void binaryFillSlot();
|
||||||
|
@ -66,8 +70,11 @@ private:
|
||||||
QAction* mFollowDump;
|
QAction* mFollowDump;
|
||||||
QAction* mFollowStack;
|
QAction* mFollowStack;
|
||||||
QMenu* mPluginMenu;
|
QMenu* mPluginMenu;
|
||||||
|
QMenu* mFollowInDumpMenu;
|
||||||
|
QList<QAction*> mFollowInDumpActions;
|
||||||
|
|
||||||
GotoDialog* mGoto;
|
GotoDialog* mGoto;
|
||||||
|
CPUMultiDump* mMultiDump;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CPUSTACK_H
|
#endif // CPUSTACK_H
|
||||||
|
|
|
@ -52,7 +52,7 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
||||||
mDump = new CPUMultiDump(mDisas, 5, 0); //dump widget
|
mDump = new CPUMultiDump(mDisas, 5, 0); //dump widget
|
||||||
ui->mBotLeftFrameLayout->addWidget(mDump);
|
ui->mBotLeftFrameLayout->addWidget(mDump);
|
||||||
|
|
||||||
mStack = new CPUStack(0); //stack widget
|
mStack = new CPUStack(mDump,0); //stack widget
|
||||||
ui->mBotRightFrameLayout->addWidget(mStack);
|
ui->mBotRightFrameLayout->addWidget(mStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue