diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 6f258f0e..40e14a0d 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -135,6 +135,8 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker ) void SourceView::Render( const Worker& worker ) { + if( m_file ) TextFocused( "File:", m_file ); + if( !m_asm.empty() && !m_lines.empty() ) { if( SmallCheckbox( ICON_FA_MICROCHIP " Show assembly", &m_showAsm ) ) @@ -219,6 +221,15 @@ void SourceView::Render( const Worker& worker ) TextFocused( "Symbol:", worker.GetString( sym->name ) ); } + if( !m_showAsm ) + { + TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_EXCLAMATION_TRIANGLE ); + ImGui::SameLine(); + TextColoredUnformatted( ImVec4( 1.f, 0.3f, 0.3f, 1.f ), "The source file contents might not reflect the actual profiled code!" ); + ImGui::SameLine(); + TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_EXCLAMATION_TRIANGLE ); + } + ImGui::BeginChild( "##sourceView", ImVec2( 0, 0 ), true ); if( m_font ) ImGui::PushFont( m_font ); const auto nw = ImGui::CalcTextSize( "123,345" ).x; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index dd2dd0f0..4fe0bf92 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -12669,15 +12669,6 @@ void View::DrawTextEditor() ImGui::SetNextWindowSize( ImVec2( 700, 800 ), ImGuiCond_FirstUseEver ); bool show = true; ImGui::Begin( "Source view", &show ); - if( m_sourceViewFile != (const char*)~uint64_t( 0 ) ) - { - TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_EXCLAMATION_TRIANGLE ); - ImGui::SameLine(); - TextColoredUnformatted( ImVec4( 1.f, 0.3f, 0.3f, 1.f ), "The source file contents might not reflect the actual profiled code!" ); - ImGui::SameLine(); - TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_EXCLAMATION_TRIANGLE ); - TextFocused( "File:", m_sourceViewFile ); - } m_sourceView->Render( m_worker ); ImGui::End(); if( !show ) m_sourceViewFile = nullptr;