1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Separate function for checking asm function context.

This commit is contained in:
Bartosz Taudul
2021-11-13 16:15:09 +01:00
parent 9ba5180b04
commit cc425c4a2d
2 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -3485,7 +3485,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
memcpy( buf+m_maxMnemonicLen, line.operands.c_str(), line.operands.size() + 1 );
}
const bool isInContext = !m_calcInlineStats || !worker.HasInlineSymbolAddresses() || worker.GetInlineSymbolForAddress( line.addr ) == m_symAddr;
const bool isInContext = IsInContext( worker, line.addr );
if( asmIdx == m_asmSelected )
{
TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, isInContext ? 1.f : 0.5f ), buf );
@@ -4732,6 +4732,11 @@ void SourceView::CheckWrite( size_t line, RegsX86 reg, size_t limit )
}
}
bool SourceView::IsInContext( const Worker& worker, uint64_t addr ) const
{
return !m_calcInlineStats || !worker.HasInlineSymbolAddresses() || worker.GetInlineSymbolForAddress( addr ) == m_symAddr;
}
#ifndef TRACY_NO_FILESELECTOR
void SourceView::Save( const Worker& worker, size_t start, size_t stop )
{