From 5e559322a00cb1253a422ec9beeb1aa89d3c8cf2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 14 Aug 2020 12:38:56 +0200 Subject: [PATCH] Properly check if symbol code is available. --- server/TracyView.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1b591688..21038d9f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -242,21 +242,23 @@ bool View::ViewDispatch( const char* fileName, int line, uint64_t symAddr ) } else { - const auto& symMap = m_worker.GetSymbolMap(); - auto sit = symMap.find( symAddr ); - auto baseAddr = symAddr; - uint32_t symlen = 0; - if( sit != symMap.end() ) symlen = sit->second.size.Val(); - if( symlen == 0 ) + uint64_t baseAddr = 0; + if( m_worker.HasSymbolCode( symAddr ) ) + { + baseAddr = symAddr; + } + else { const auto parentAddr = m_worker.GetSymbolForAddress( symAddr ); if( parentAddr != 0 ) { - auto pit = symMap.find( parentAddr ); - if( pit != symMap.end() ) baseAddr = parentAddr; + if( m_worker.HasSymbolCode( parentAddr ) ) + { + baseAddr = parentAddr; + } } } - if( symlen != 0 || line != 0 ) + if( baseAddr != 0 || line != 0 ) { ViewSymbol( fileName, line, baseAddr, symAddr ); return true;