Skip to content
Permalink
Browse files

DisassemblerView: Display function name only if needed

  • Loading branch information...
Dax89 committed May 23, 2019
1 parent f715c41 commit 76105dcf0c95ca51471e76d6d903ba8c9493d055
Showing with 6 additions and 11 deletions.
  1. +6 −11 widgets/disassemblerview/disassemblerview.cpp
@@ -330,19 +330,14 @@ void DisassemblerView::displayAddress(address_t address)
s += QString::fromWCharArray(L"<b>Offset: </b>%1\u00A0\u00A0").arg(offs);
s += QString::fromWCharArray(L"<b>Segment: </b>%1\u00A0\u00A0").arg(segm);

if(document->currentItem())
if(document->currentItem() && functionstart)
{
QString func = "UNKNOWN";
QString func = S_TO_QS(functionstart->name);

if(functionstart)
{
func = S_TO_QS(functionstart->name);

if(address > functionstart->address)
func += "+" + S_TO_QS(REDasm::hex(address - functionstart->address, 8));
else if(address < functionstart->address)
func += S_TO_QS(REDasm::hex<REDasm::signed_of<size_t>::type>(address - functionstart->address));
}
if(address > functionstart->address)
func += "+" + S_TO_QS(REDasm::hex(address - functionstart->address, 8));
else if(address < functionstart->address)
func += S_TO_QS(REDasm::hex<REDasm::signed_of<size_t>::type>(address - functionstart->address));

s = QString::fromWCharArray(L"<b>Function: </b>%1\u00A0\u00A0").arg(func) + s;
}

0 comments on commit 76105dc

Please sign in to comment.
You can’t perform that action at this time.