Update infobox when selection in graph changes
This commit is contained in:
parent
a72cfd710f
commit
fb312d7169
|
|
@ -23,7 +23,7 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
mSideBar = new CPUSideBar(mDisas);
|
||||
mDisas->setSideBar(mSideBar);
|
||||
mArgumentWidget = new CPUArgumentWidget(this);
|
||||
mGraphView = new DisassemblerGraphView(this);
|
||||
mGraph = new DisassemblerGraphView(this);
|
||||
|
||||
connect(mDisas, SIGNAL(tableOffsetChanged(dsint)), mSideBar, SLOT(changeTopmostAddress(dsint)));
|
||||
connect(mDisas, SIGNAL(viewableRowsChanged(int)), mSideBar, SLOT(setViewableRows(int)));
|
||||
|
|
@ -38,8 +38,8 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
|
||||
ui->mTopLeftUpperLeftFrameLayout->addWidget(mSideBar);
|
||||
ui->mTopLeftUpperRightFrameLayout->addWidget(mDisas);
|
||||
ui->mTopLeftUpperRightFrameLayout->addWidget(mGraphView);
|
||||
mGraphView->hide();
|
||||
ui->mTopLeftUpperRightFrameLayout->addWidget(mGraph);
|
||||
mGraph->hide();
|
||||
disasMode = true;
|
||||
|
||||
ui->mTopLeftVSplitter->setCollapsible(1, true); //allow collapsing of the InfoBox
|
||||
|
|
@ -157,10 +157,12 @@ void CPUWidget::setDisasmFocus()
|
|||
{
|
||||
if(!disasMode)
|
||||
{
|
||||
mGraphView->hide();
|
||||
mGraph->hide();
|
||||
mDisas->show();
|
||||
mSideBar->show();
|
||||
disasMode = true;
|
||||
connect(mDisas, SIGNAL(selectionChanged(dsint)), mInfo, SLOT(disasmSelectionChanged(dsint)));
|
||||
disconnect(mGraph, SIGNAL(selectionChanged(dsint)), mInfo, SLOT(disasmSelectionChanged(dsint)));
|
||||
}
|
||||
mDisas->setFocus();
|
||||
}
|
||||
|
|
@ -171,15 +173,17 @@ void CPUWidget::setGraphFocus()
|
|||
{
|
||||
mDisas->hide();
|
||||
mSideBar->hide();
|
||||
mGraphView->show();
|
||||
mGraph->show();
|
||||
disasMode = false;
|
||||
disconnect(mDisas, SIGNAL(selectionChanged(dsint)), mInfo, SLOT(disasmSelectionChanged(dsint)));
|
||||
connect(mGraph, SIGNAL(selectionChanged(dsint)), mInfo, SLOT(disasmSelectionChanged(dsint)));
|
||||
}
|
||||
mGraphView->setFocus();
|
||||
mGraph->setFocus();
|
||||
}
|
||||
|
||||
duint CPUWidget::getSelectionVa()
|
||||
{
|
||||
return disasMode ? mDisas->getSelectedVa() : mGraphView->get_cursor_pos();
|
||||
return disasMode ? mDisas->getSelectedVa() : mGraph->get_cursor_pos();
|
||||
}
|
||||
|
||||
CPUSideBar* CPUWidget::getSidebarWidget()
|
||||
|
|
@ -211,8 +215,9 @@ void CPUWidget::splitterMoved(int pos, int index)
|
|||
{
|
||||
Q_UNUSED(pos);
|
||||
Q_UNUSED(index);
|
||||
auto splitter = (QSplitter*)sender();
|
||||
if(splitter->sizes().at(1) == 0)
|
||||
auto splitter = qobject_cast<QSplitter*>(sender());
|
||||
if(splitter == nullptr) {} // ???
|
||||
else if(splitter->sizes().at(1) == 0)
|
||||
{
|
||||
splitter->handle(1)->setCursor(Qt::UpArrowCursor);
|
||||
splitter->setStyleSheet("QSplitter::handle:vertical { border-top: 2px solid grey; }");
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public:
|
|||
protected:
|
||||
CPUSideBar* mSideBar;
|
||||
CPUDisassembly* mDisas;
|
||||
DisassemblerGraphView* mGraphView;
|
||||
DisassemblerGraphView* mGraph;
|
||||
CPUMultiDump* mDump;
|
||||
CPUStack* mStack;
|
||||
CPURegistersView* mGeneralRegs;
|
||||
|
|
|
|||
|
|
@ -1080,7 +1080,10 @@ void DisassemblerGraphView::mousePressEvent(QMouseEvent* event)
|
|||
//Update current instruction
|
||||
duint instr = this->getInstrForMouseEvent(event);
|
||||
if(instr != 0)
|
||||
{
|
||||
this->cur_instr = instr;
|
||||
emit selectionChanged(instr);
|
||||
}
|
||||
|
||||
this->viewport()->update();
|
||||
|
||||
|
|
@ -1905,6 +1908,7 @@ bool DisassemblerGraphView::navigate(duint addr)
|
|||
this->cur_instr = instr.addr;
|
||||
this->show_cur_instr();
|
||||
this->viewport()->update();
|
||||
emit selectionChanged(addr);
|
||||
return true;
|
||||
}
|
||||
row += int(instr.text.lines.size());
|
||||
|
|
@ -1921,6 +1925,7 @@ bool DisassemblerGraphView::navigate(duint addr)
|
|||
this->ready = false;
|
||||
this->desired_pos = nullptr;
|
||||
this->viewport()->update();
|
||||
emit selectionChanged(addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ public:
|
|||
|
||||
VaHistory mHistory;
|
||||
|
||||
signals:
|
||||
void selectionChanged(dsint parVA);
|
||||
|
||||
public slots:
|
||||
void loadGraphSlot(BridgeCFGraphList* graph, duint addr);
|
||||
void graphAtSlot(duint addr);
|
||||
|
|
|
|||
|
|
@ -226,8 +226,9 @@ SOURCES += \
|
|||
gui/Src/BasicView/AbstractStdTable.cpp \
|
||||
gui/Src/Gui/ZehSymbolTable.cpp \
|
||||
gui/Src/BasicView/StdSearchListView.cpp \
|
||||
gui/Src/Gui/CPURegistersView.cpp \
|
||||
gui/Src/Tracer/TraceWidget.cpp
|
||||
gui/Src/Gui/CPURegistersView.cpp \
|
||||
gui/Src/Tracer/TraceRegisters.cpp \
|
||||
gui/Src/Tracer/TraceWidget.cpp
|
||||
|
||||
HEADERS += \
|
||||
gui/Src/Exports.h \
|
||||
|
|
@ -465,8 +466,9 @@ HEADERS += \
|
|||
gui/Src/BasicView/AbstractStdTable.h \
|
||||
gui/Src/Gui/ZehSymbolTable.h \
|
||||
gui/Src/BasicView/StdSearchListView.h \
|
||||
gui/Src/Gui/CPURegistersView.h \
|
||||
gui/Src/Tracer/TraceWidget.h
|
||||
gui/Src/Gui/CPURegistersView.h \
|
||||
gui/Src/Tracer/TraceRegisters.h \
|
||||
gui/Src/Tracer/TraceWidget.h
|
||||
|
||||
FORMS += \
|
||||
gui/Src/Gui/AppearanceDialog.ui \
|
||||
|
|
@ -506,7 +508,7 @@ FORMS += \
|
|||
gui/Src/Gui/StructWidget.ui \
|
||||
gui/Src/Gui/MessagesBreakpoints.ui \
|
||||
gui/Src/Gui/AboutDialog.ui \
|
||||
gui/Src/Tracer/TraceWidget.ui
|
||||
gui/Src/Tracer/TraceWidget.ui
|
||||
|
||||
TRANSLATIONS += \
|
||||
gui/Translations/x64dbg.ts
|
||||
Loading…
Reference in New Issue