Symbol might be unavailable.

This commit is contained in:
Bartosz Taudul 2024-09-28 01:09:49 +02:00
parent 6721db8600
commit 8740ea710a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -193,11 +193,19 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
else else
{ {
auto sym = m_worker.GetSymbolData( (uint64_t)item.srcloc ); auto sym = m_worker.GetSymbolData( (uint64_t)item.srcloc );
if( sym )
{
name = m_worker.GetString( sym->name ); name = m_worker.GetString( sym->name );
auto namehash = charutil::hash( name ); auto namehash = charutil::hash( name );
if( namehash == 0 ) namehash++; if( namehash == 0 ) namehash++;
color = GetHsvColor( namehash, depth ); color = GetHsvColor( namehash, depth );
} }
else
{
name = "???";
color = 0xFF888888;
}
}
const auto hiColor = HighlightColor( color ); const auto hiColor = HighlightColor( color );
const auto darkColor = DarkenColor( color ); const auto darkColor = DarkenColor( color );