From 18a460e782a1c5f260fcb5dec460142dd05bcc02 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 17 Jul 2018 23:08:10 +0200 Subject: [PATCH] Clicking on mem address in alloc list displays info window. --- server/TracyView.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 20b7390a..09c9f60d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5252,6 +5252,14 @@ void View::ListMemData( T ptr, T end, std::function DrawAdd ImGui::BeginChild( id ? id : "##memScroll", ImVec2( 0, std::max( ty * std::min( dist, 5 ), std::min( ty * dist, ImGui::GetContentRegionAvail().y ) ) ) ); ImGui::Columns( 8 ); ImGui::Text( "Address" ); + ImGui::SameLine(); + ImGui::TextDisabled( "(?)" ); + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + ImGui::Text( "Click on address to display memory allocation info window." ); + ImGui::EndTooltip(); + } ImGui::NextColumn(); ImGui::Text( "Size" ); ImGui::NextColumn(); @@ -5302,10 +5310,17 @@ void View::ListMemData( T ptr, T end, std::function DrawAdd ImGui::Text( "Callstack" ); ImGui::NextColumn(); ImGui::Separator(); + + const auto& mem = m_worker.GetMemData(); + int idx = 0; while( ptr != end ) { auto v = DrawAddress( ptr ); + if( ImGui::IsItemClicked() ) + { + m_memoryAllocInfoWindow = std::distance( mem.data.begin(), v ); + } ImGui::NextColumn(); ImGui::Text( "%s", RealToString( v->size, true ) ); ImGui::NextColumn();