diff --git a/profiler/src/profiler/TracySourceView.cpp b/profiler/src/profiler/TracySourceView.cpp index 6941f88a..2d6fccc6 100644 --- a/profiler/src/profiler/TracySourceView.cpp +++ b/profiler/src/profiler/TracySourceView.cpp @@ -2382,6 +2382,31 @@ static int PrintHexBytes( const uint8_t* bytes, size_t len, CpuArchitecture arch } } +std::tuple SourceView::GetJumpRange( const JumpData& jump ) +{ + size_t minIdx = 0, maxIdx = 0; + size_t i; + for( i=0; isecond.min ) - { - minIdx = i++; - break; - } - } - assert( i != m_asm.size() ); - for( ; isecond.max ) - { - maxIdx = i+1; - break; - } - } - assert( i != m_asm.size() ); - + auto [minIdx, maxIdx] = GetJumpRange( it->second ); Save( worker, minIdx, maxIdx ); ImGui::CloseCurrentPopup(); } diff --git a/profiler/src/profiler/TracySourceView.hpp b/profiler/src/profiler/TracySourceView.hpp index 3567f4e2..9607f0e3 100644 --- a/profiler/src/profiler/TracySourceView.hpp +++ b/profiler/src/profiler/TracySourceView.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include "tracy_robin_hood.h" @@ -213,6 +214,7 @@ private: const std::vector* GetAddressesForLocation( uint32_t fileStringIdx, uint32_t line, const Worker& worker ); tracy_force_inline float CalcJumpSeparation( float scale ); + std::tuple GetJumpRange( const JumpData& jump ); #ifndef TRACY_NO_FILESELECTOR void Save( const Worker& worker, size_t start = 0, size_t stop = std::numeric_limits::max() );