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

Darken assembly instructions which aren't in current context.

This commit is contained in:
Bartosz Taudul 2021-06-19 20:11:53 +02:00
parent 53111f9dd9
commit 748c22df8e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3363,9 +3363,10 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
memcpy( buf+m_maxMnemonicLen, line.operands.c_str(), line.operands.size() + 1 ); 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;
if( asmIdx == m_asmSelected ) if( asmIdx == m_asmSelected )
{ {
TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, 1 ), buf ); TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, isInContext ? 1.f : 0.5f ), buf );
} }
else if( line.regData[0] != 0 ) else if( line.regData[0] != 0 )
{ {
@ -3383,16 +3384,30 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
} }
if( hasDepencency ) if( hasDepencency )
{ {
TextColoredUnformatted( ImVec4( 1, 0.5f, 1, 1 ), buf ); TextColoredUnformatted( ImVec4( 1, 0.5f, 1, isInContext ? 1.f : 0.5f ), buf );
} }
else else
{ {
ImGui::TextUnformatted( buf ); if( isInContext )
{
ImGui::TextUnformatted( buf );
}
else
{
TextDisabledUnformatted( buf );
}
} }
} }
else else
{ {
ImGui::TextUnformatted( buf ); if( isInContext )
{
ImGui::TextUnformatted( buf );
}
else
{
TextDisabledUnformatted( buf );
}
} }
uint32_t jumpOffset; uint32_t jumpOffset;