GUI: non-modal XrefBrowseDialog so you can browse around the cross references more easily
This commit is contained in:
parent
1bd0bf9d63
commit
0421420484
|
|
@ -1087,8 +1087,11 @@ void CPUDisassembly::gotoXrefSlot()
|
|||
{
|
||||
if(!DbgIsDebugging() || !mXrefInfo.refcount)
|
||||
return;
|
||||
XrefBrowseDialog xrefDlg(this, getSelectedVa());
|
||||
xrefDlg.exec();
|
||||
if(!mXrefDlg)
|
||||
mXrefDlg = new XrefBrowseDialog(this);
|
||||
mXrefDlg->setup(getSelectedVa());
|
||||
mXrefDlg->showNormal();
|
||||
mXrefDlg->setFocus();
|
||||
}
|
||||
|
||||
void CPUDisassembly::followActionSlot()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
// Needed forward declaration for parent container class
|
||||
class CPUWidget;
|
||||
class GotoDialog;
|
||||
class XrefBrowseDialog;
|
||||
|
||||
class CPUDisassembly : public Disassembly
|
||||
{
|
||||
|
|
@ -24,7 +25,6 @@ public:
|
|||
void addFollowReferenceMenuItem(QString name, dsint value, QMenu* menu, bool isReferences, bool isFollowInCPU);
|
||||
void setupFollowReferenceMenu(dsint wVA, QMenu* menu, bool isReferences, bool isFollowInCPU);
|
||||
void setHwBpAt(duint va, int slot);
|
||||
|
||||
void copySelectionSlot(bool copyBytes);
|
||||
|
||||
signals:
|
||||
|
|
@ -147,6 +147,7 @@ private:
|
|||
|
||||
// Goto dialog specific
|
||||
GotoDialog* mGoto;
|
||||
XrefBrowseDialog* mXrefDlg = nullptr;
|
||||
|
||||
// Parent CPU window
|
||||
CPUWidget* mParentCPUWindow;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@
|
|||
#include "ui_XrefBrowseDialog.h"
|
||||
#include "StringUtil.h"
|
||||
|
||||
XrefBrowseDialog::XrefBrowseDialog(QWidget* parent, duint address) :
|
||||
XrefBrowseDialog::XrefBrowseDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::XrefBrowseDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::MSWindowsFixedSizeDialogHint);
|
||||
setWindowIcon(DIcon("xrefs.png"));
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
void XrefBrowseDialog::setup(duint address, QString command)
|
||||
{
|
||||
mCommand = command;
|
||||
mAddress = address;
|
||||
mPrevSelectionSize = 0;
|
||||
if(DbgXrefGet(address, &mXrefInfo))
|
||||
|
|
@ -28,7 +34,7 @@ XrefBrowseDialog::XrefBrowseDialog(QWidget* parent, duint address) :
|
|||
|
||||
void XrefBrowseDialog::changeAddress(duint address)
|
||||
{
|
||||
DbgCmdExec(QString().sprintf("disasm \"%p\"", address).toUtf8().constData());
|
||||
DbgCmdExec(QString("%1 %2").arg(mCommand, ToPtrString(address)).toUtf8().constData());
|
||||
}
|
||||
|
||||
XrefBrowseDialog::~XrefBrowseDialog()
|
||||
|
|
@ -69,5 +75,10 @@ void XrefBrowseDialog::on_listWidget_currentRowChanged(int row)
|
|||
|
||||
void XrefBrowseDialog::on_XrefBrowseDialog_rejected()
|
||||
{
|
||||
DbgCmdExec(QString().sprintf("disasm \"%p\"", mAddress).toUtf8().constData());
|
||||
DbgCmdExec(QString("%1 %2").arg(mCommand, ToPtrString(mAddress)).toUtf8().constData());
|
||||
}
|
||||
|
||||
void XrefBrowseDialog::on_listWidget_itemClicked(QListWidgetItem*)
|
||||
{
|
||||
on_listWidget_currentRowChanged(ui->listWidget->currentRow());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,20 +15,23 @@ class XrefBrowseDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit XrefBrowseDialog(QWidget* parent, duint address);
|
||||
explicit XrefBrowseDialog(QWidget* parent);
|
||||
~XrefBrowseDialog();
|
||||
void setup(duint address, QString command = "disasm");
|
||||
|
||||
private slots:
|
||||
void on_listWidget_itemDoubleClicked(QListWidgetItem* item);
|
||||
void on_listWidget_itemSelectionChanged();
|
||||
void on_listWidget_currentRowChanged(int currentRow);
|
||||
void on_XrefBrowseDialog_rejected();
|
||||
void on_listWidget_itemClicked(QListWidgetItem* item);
|
||||
|
||||
private:
|
||||
Ui::XrefBrowseDialog* ui;
|
||||
XREF_INFO mXrefInfo;
|
||||
duint mAddress;
|
||||
int mPrevSelectionSize;
|
||||
QString mCommand;
|
||||
void changeAddress(duint address);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue