Normalize frame names in memory callstack tree.

This commit is contained in:
Bartosz Taudul 2022-08-15 21:29:21 +02:00
parent 9c4f257596
commit baf365c0c3
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -440,10 +440,16 @@ void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, MemCallstackFr
{
TextColoredUnformatted( 0xFF8888FF, frameName );
}
else
else if( m_shortenName == ShortenName::Never )
{
ImGui::TextUnformatted( frameName );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
ImGui::TextUnformatted( normalized );
TooltipNormalizedName( frameName, normalized );
}
ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() );
}
else
@ -452,13 +458,31 @@ void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, MemCallstackFr
if( frameName[0] == '[' ) ImGui::PushStyleColor( ImGuiCol_Text, 0x88FFFFFF );
else if( isKernel ) ImGui::PushStyleColor( ImGuiCol_Text, 0xFF8888FF );
if( tree.size() == 1 )
{
if( m_shortenName == ShortenName::Never )
{
expand = ImGui::TreeNodeEx( frameName, ImGuiTreeNodeFlags_DefaultOpen );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
expand = ImGui::TreeNodeEx( normalized, ImGuiTreeNodeFlags_DefaultOpen );
TooltipNormalizedName( frameName, normalized );
}
}
else
{
if( m_shortenName == ShortenName::Never )
{
expand = ImGui::TreeNode( frameName );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
expand = ImGui::TreeNode( normalized );
TooltipNormalizedName( frameName, normalized );
}
}
if( isKernel || frameName[0] == '[' ) ImGui::PopStyleColor();
ImGui::PopID();
}