Fixed labels on non-data members of assembly.

This commit is contained in:
mlong 2021-01-23 15:38:53 -06:00
parent 6d8efdd483
commit 531a670dca
2 changed files with 16 additions and 0 deletions

View File

@ -77,6 +77,7 @@ void DisassemblerViewer::setFile(BinaryFile *file) {
m_file = file;
m_isRelo = false;
setCursor(Qt::WaitCursor);
m_bfm = new BinaryFileMetadata(m_file, file->address(), this);
connect(m_bfm, &BinaryFileMetadata::doDisassemble,
@ -92,12 +93,15 @@ void DisassemblerViewer::setFile(BinaryFile *file) {
QList<quint16> addresses = m_bfm->entryPoints()->getEntryPointAddresses();
if (!addresses.count()) { addresses.append(address); }
handleDisassembleRequest(addresses);
unsetCursor();
}
void DisassemblerViewer::setFile(RelocatableFile *file) {
m_file = file;
m_isRelo = true;
setCursor(Qt::WaitCursor);
m_bfm = new BinaryFileMetadata(m_file, file->address() + 6, this);
connect(m_bfm, &BinaryFileMetadata::doDisassemble,
@ -113,6 +117,7 @@ void DisassemblerViewer::setFile(RelocatableFile *file) {
QList<quint16> addresses = m_bfm->entryPoints()->getEntryPointAddresses();
if (!addresses.count()) { addresses.append(address); }
handleDisassembleRequest(addresses);
unsetCursor();
}
void DisassemblerViewer::handleDisassembleRequest(QList<quint16> addresses)
@ -227,6 +232,10 @@ void DisassemblerViewer::disassemble(QList<quint16> entryPoints) {
usedefault = true;
}
}
else
{
usedefault = true;
}
if (usedefault)
{

View File

@ -25,6 +25,7 @@ public:
void setJumpLines(JumpLines *jl);
void proxyWheelEvent(QWheelEvent *ev) { if (ev) { wheelEvent(ev); } }
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
@ -35,6 +36,9 @@ protected:
QRect getBlockGeometry(QTextBlock block) const;
bool isBlockVisible(QTextBlock block) const;
void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
// void wheelEvent(QWheelEvent *ev) Q_DECL_OVERRIDE { if (ev) { ev->ignore(); } }
private slots:
void updateLineAreaWidth();
void updateLineArea(const QRect &, int);
@ -68,6 +72,9 @@ protected:
m_browser->lineAreaPaintEvent(event);
}
void wheelEvent(QWheelEvent *ev) Q_DECL_OVERRIDE { m_browser->proxyWheelEvent(ev); }
private:
FlowLineTextBrowser *m_browser;
JumpLines *m_jl;