From f59f4f266e1ba7db4195bc4603a76dd51b04303e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 8 Apr 2020 15:34:14 +0200 Subject: [PATCH] Add inline symbols list accessor. --- server/TracyWorker.cpp | 8 ++++++++ server/TracyWorker.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 283b4a8d..44a70c7e 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2433,6 +2433,14 @@ const Vector* Worker::GetAddressesForLocation( uint32_t fileStringIdx, } } +const uint64_t* Worker::GetInlineSymbolList( uint64_t sym, uint32_t len ) const +{ + auto it = std::lower_bound( m_data.symbolLocInline.begin(), m_data.symbolLocInline.end(), sym ); + if( it == m_data.symbolLocInline.end() ) return nullptr; + if( *it >= sym + len ) return nullptr; + return it; +} + int64_t Worker::GetZoneEnd( const ZoneEvent& ev ) { auto ptr = &ev; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 6a9beaf4..8e974400 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -441,6 +441,7 @@ public: uint64_t GetSymbolForAddress( uint64_t address, uint32_t& offset ) const; StringIdx GetLocationForAddress( uint64_t address, uint32_t& line ) const; const Vector* GetAddressesForLocation( uint32_t fileStringIdx, uint32_t line ) const; + const uint64_t* GetInlineSymbolList( uint64_t sym, uint32_t len ) const; #ifndef TRACY_NO_STATISTICS const VarArray& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; }