mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Don't show invalid contents warning for disassembly.
This commit is contained in:
parent
39923e942b
commit
52a853b26f
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user