GUI: fix cip not displaying correctly in the reference view
This commit is contained in:
parent
d2410a0835
commit
0f1916cc2e
|
@ -5,12 +5,10 @@
|
|||
|
||||
SearchListViewTable::SearchListViewTable(StdTable* parent)
|
||||
: StdTable(parent),
|
||||
bCipBase(false),
|
||||
mCip(0)
|
||||
bCipBase(false)
|
||||
{
|
||||
highlightText = "";
|
||||
updateColors();
|
||||
connect(Bridge::getBridge(), SIGNAL(disassembleAt(dsint, dsint)), this, SLOT(disassembleAtSlot(dsint, dsint)));
|
||||
}
|
||||
|
||||
void SearchListViewTable::updateColors()
|
||||
|
@ -87,7 +85,15 @@ QString SearchListViewTable::paintContent(QPainter* painter, dsint rowBase, int
|
|||
BPXTYPE bpxtype = DbgGetBpxTypeAt(wVA);
|
||||
bool isbookmark = DbgGetBookmarkAt(wVA);
|
||||
|
||||
if(wVA == mCip) //cip + not running
|
||||
duint cip = Bridge::getBridge()->mLastCip;
|
||||
if(bCipBase)
|
||||
{
|
||||
duint base = DbgFunctions()->ModBaseFromAddr(cip);
|
||||
if(base)
|
||||
cip = base;
|
||||
}
|
||||
|
||||
if(DbgIsDebugging() && wVA == cip) //cip + not running
|
||||
{
|
||||
painter->fillRect(QRect(x, y, w, h), QBrush(mCipBackgroundColor));
|
||||
if(!isbookmark) //no bookmark
|
||||
|
@ -297,14 +303,3 @@ QString SearchListViewTable::paintContent(QPainter* painter, dsint rowBase, int
|
|||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
void SearchListViewTable::disassembleAtSlot(dsint va, dsint cip)
|
||||
{
|
||||
Q_UNUSED(va);
|
||||
mCip = cip;
|
||||
if(!bCipBase)
|
||||
return;
|
||||
duint base = DbgFunctions()->ModBaseFromAddr(mCip);
|
||||
if(base)
|
||||
mCip = base;
|
||||
}
|
||||
|
|
|
@ -19,9 +19,6 @@ public:
|
|||
protected:
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
|
||||
public slots:
|
||||
void disassembleAtSlot(dsint va, dsint cip);
|
||||
|
||||
private:
|
||||
QColor mCipBackgroundColor;
|
||||
QColor mCipColor;
|
||||
|
@ -39,7 +36,6 @@ private:
|
|||
QColor mAddressColor;
|
||||
QColor mTracedBackgroundColor;
|
||||
QColor mTracedSelectedAddressBackgroundColor;
|
||||
duint mCip;
|
||||
bool bCipBase;
|
||||
};
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
switch(type)
|
||||
{
|
||||
case GUI_DISASSEMBLE_AT:
|
||||
mLastCip = (duint)param2;
|
||||
emit disassembleAt((dsint)param1, (dsint)param2);
|
||||
break;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
ReferenceManager* referenceManager = nullptr;
|
||||
QWidget* snowmanView = nullptr;
|
||||
bool mIsRunning = false;
|
||||
duint mLastCip = 0;
|
||||
|
||||
signals:
|
||||
void disassembleAt(dsint va, dsint eip);
|
||||
|
|
|
@ -23,9 +23,6 @@ SourceView::SourceView(QString path, int line, QWidget* parent)
|
|||
|
||||
loadFile();
|
||||
setSelection(line);
|
||||
auto cip = DbgValFromString("cip");
|
||||
mList->disassembleAtSlot(0, cip);
|
||||
mSearchList->disassembleAtSlot(0, cip);
|
||||
|
||||
mMenuBuilder = new MenuBuilder(this);
|
||||
mMenuBuilder->addAction(makeAction(DIcon("source.png"), tr("Open source file"), SLOT(openSourceFileSlot())));
|
||||
|
|
Loading…
Reference in New Issue