From 2c18097bf9699a78dbc05306fbf8cd01eb65515d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 7 Oct 2023 01:28:10 +0200 Subject: [PATCH] Symbol history walking. --- server/TracySourceView.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index c7dccd0f..8786e9bc 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1146,6 +1146,22 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) auto sym = worker.GetSymbolData( m_symAddr ); assert( sym ); ImGui::PushFont( m_bigFont ); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); + if( ButtonDisablable( " " ICON_FA_CARET_LEFT " ", m_historyCursor <= 1 ) ) + { + m_historyCursor--; + const auto& entry = m_history[m_historyCursor-1]; + OpenSymbol( entry.fileName, entry.line, entry.baseAddr, entry.symAddr, worker, view, false ); + } + ImGui::SameLine( 0, 0 ); + if( ButtonDisablable( " " ICON_FA_CARET_RIGHT " ", m_historyCursor == m_history.size() ) ) + { + m_historyCursor++; + const auto& entry = m_history[m_historyCursor-1]; + OpenSymbol( entry.fileName, entry.line, entry.baseAddr, entry.symAddr, worker, view, false ); + } + ImGui::PopStyleVar(); + ImGui::SameLine(); if( sym->isInline ) { auto parent = worker.GetSymbolData( m_baseAddr );