1
0
Fork 0

GUI: fix cip not displaying correctly in the reference view

This commit is contained in:
Duncan Ogilvie 2017-12-18 02:02:35 +01:00
parent d2410a0835
commit 0f1916cc2e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
5 changed files with 12 additions and 22 deletions

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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;

View File

@ -41,6 +41,7 @@ public:
ReferenceManager* referenceManager = nullptr;
QWidget* snowmanView = nullptr;
bool mIsRunning = false;
duint mLastCip = 0;
signals:
void disassembleAt(dsint va, dsint eip);

View File

@ -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())));