1
0
Fork 0

Merge pull request #3146 from HayFieldLaps/development

Update References tab highlighting
development
Duncan Ogilvie 2023-08-08 21:42:55 +02:00 committed by GitHub
commit b0e4888c5f
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

View File

@ -248,12 +248,16 @@ void ReferenceView::referenceContextMenu(QMenu* wMenu)
void ReferenceView::followAddress()
{
DbgCmdExecDirect(QString("disasm " + mCurList->getCellContent(mCurList->getInitialSelection(), 0)));
int index = mCurList->getInitialSelection();
searchSelectionChanged(index);
DbgCmdExecDirect(QString("disasm " + mCurList->getCellContent(index, 0)));
}
void ReferenceView::followDumpAddress()
{
DbgCmdExecDirect(QString("dump " + mCurList->getCellContent(mCurList->getInitialSelection(), 0)));
int index = mCurList->getInitialSelection();
searchSelectionChanged(index);
DbgCmdExecDirect(QString("dump " + mCurList->getCellContent(index, 0)));
}
void ReferenceView::followApiAddress()

View File

@ -1052,6 +1052,7 @@ void CPUDisassembly::gotoPreviousReferenceSlot()
if(index > 0 && addr == rvaToVa(getInitialSelection()))
DbgValToString("$__disasm_refindex", index - 1);
gotoAddress(DbgValFromString("refsearch.addr($__disasm_refindex)"));
GuiReferenceSetSingleSelection(int(DbgEval("$__disasm_refindex")), false);
}
}
@ -1063,6 +1064,7 @@ void CPUDisassembly::gotoNextReferenceSlot()
if(index + 1 < count && addr == rvaToVa(getInitialSelection()))
DbgValToString("$__disasm_refindex", index + 1);
gotoAddress(DbgValFromString("refsearch.addr($__disasm_refindex)"));
GuiReferenceSetSingleSelection(int(DbgEval("$__disasm_refindex")), false);
}
}

View File

@ -614,6 +614,7 @@ void CPUDump::gotoPreviousReferenceSlot()
if(index > 0 && addr == rvaToVa(getInitialSelection()))
DbgValToString("$__dump_refindex", index - 1);
DbgCmdExec("dump refsearch.addr($__dump_refindex)");
GuiReferenceSetSingleSelection(int(DbgEval("$__dump_refindex")), false);
}
}
@ -625,6 +626,7 @@ void CPUDump::gotoNextReferenceSlot()
if(index + 1 < count && addr == rvaToVa(getInitialSelection()))
DbgValToString("$__dump_refindex", index + 1);
DbgCmdExec("dump refsearch.addr($__dump_refindex)");
GuiReferenceSetSingleSelection(int(DbgEval("$__dump_refindex")), false);
}
}

View File

@ -21,6 +21,18 @@ ReferenceManager::ReferenceManager(QWidget* parent) : QTabWidget(parent)
ReferenceView* ReferenceManager::currentReferenceView()
{
//get the current index, disconnects the previous view if it's not the current one, set and connect the new current view, then return it
int currentIndex = QTabWidget::currentIndex();
if(mCurrentReferenceView && mCurrentReferenceView != widget(currentIndex))
{
mCurrentReferenceView->disconnectBridge();
mCurrentReferenceView = qobject_cast<ReferenceView*>(widget(currentIndex));
if(mCurrentReferenceView)
mCurrentReferenceView->connectBridge();
}
return mCurrentReferenceView;
}