From 7a1fb4e0bd71c38b0dd7d41ec7471040b4693e7f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 21 Sep 2019 00:56:56 +0200 Subject: [PATCH] Proper message when call stack trees are not available. --- server/TracyView.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 551f2f1d..d5d11a4a 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11889,6 +11889,7 @@ void View::DrawMemory() ImGui::TreePop(); } + ImGui::Separator(); #ifdef TRACY_EXTENDED_FONT if( ImGui::TreeNode( ICON_FA_ALIGN_JUSTIFY " Bottom-up call stack tree" ) ) @@ -11912,8 +11913,15 @@ void View::DrawMemory() auto& mem = m_worker.GetMemData(); auto tree = GetCallstackFrameTreeBottomUp( mem ); - int idx = 0; - DrawFrameTreeLevel( tree, idx ); + if( !tree.empty() ) + { + int idx = 0; + DrawFrameTreeLevel( tree, idx ); + } + else + { + TextDisabledUnformatted( "No call stack data collected" ); + } ImGui::TreePop(); } @@ -11941,8 +11949,15 @@ void View::DrawMemory() auto& mem = m_worker.GetMemData(); auto tree = GetCallstackFrameTreeTopDown( mem ); - int idx = 0; - DrawFrameTreeLevel( tree, idx ); + if( !tree.empty() ) + { + int idx = 0; + DrawFrameTreeLevel( tree, idx ); + } + else + { + TextDisabledUnformatted( "No call stack data collected" ); + } ImGui::TreePop(); }