Allow assembly view in all calls to SetTextEditorFile.

This commit is contained in:
Bartosz Taudul 2020-03-27 21:46:16 +01:00
parent 78ea40d70c
commit d065d28244

View File

@ -3508,12 +3508,9 @@ int View::DrawGhostLevel( const Vector<GhostZone>& vec, bool hover, double pxns,
ImGui::EndTooltip(); ImGui::EndTooltip();
if( ImGui::IsMouseClicked( 0 ) ) if( ImGui::IsMouseClicked( 0 ) )
{
if( line != 0 )
{ {
SetTextEditorFile( file, line, frame->data[i].symAddr ); SetTextEditorFile( file, line, frame->data[i].symAddr );
} }
}
else if( !m_zoomAnim.active && ImGui::IsMouseClicked( 2 ) ) else if( !m_zoomAnim.active && ImGui::IsMouseClicked( 2 ) )
{ {
ZoomToRange( ev.start.Val(), ev.end.Val() ); ZoomToRange( ev.start.Val(), ev.end.Val() );
@ -6009,11 +6006,7 @@ void DrawZoneTrace( T zone, const std::vector<T>& trace, const Worker& worker, B
} }
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{ {
if( frame->line != 0 && SourceFileValid( fileName, worker.GetCaptureTime() ) ) if( !view.SetTextEditorFile( fileName, frame->line, frame->symAddr ) )
{
view.SetTextEditorFile( fileName, frame->line, 0 );
}
else
{ {
anim.Enable( frame, 0.5f ); anim.Enable( frame, 0.5f );
} }
@ -6071,11 +6064,7 @@ void DrawZoneTrace( T zone, const std::vector<T>& trace, const Worker& worker, B
} }
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{ {
if( frame->line != 0 && SourceFileValid( fileName, worker.GetCaptureTime() ) ) if( !view.SetTextEditorFile( fileName, frame->line, frame->symAddr ) )
{
view.SetTextEditorFile( fileName, frame->line, 0 );
}
else
{ {
anim.Enable( frame, 0.5f ); anim.Enable( frame, 0.5f );
} }
@ -11797,11 +11786,7 @@ void View::DrawCallstackWindow()
if( sym ) if( sym )
{ {
const auto symtxt = m_worker.GetString( sym->file ); const auto symtxt = m_worker.GetString( sym->file );
if( SourceFileValid( symtxt, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( symtxt, sym->line, frame.symAddr ) )
{
SetTextEditorFile( symtxt, sym->line, frame.symAddr );
}
else
{ {
m_callstackBuzzAnim.Enable( bidx, 0.5f ); m_callstackBuzzAnim.Enable( bidx, 0.5f );
} }
@ -11813,11 +11798,7 @@ void View::DrawCallstackWindow()
} }
else else
{ {
if( SourceFileValid( txt, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( txt, frame.line, frame.symAddr ) )
{
SetTextEditorFile( txt, frame.line, frame.symAddr );
}
else
{ {
m_callstackBuzzAnim.Enable( bidx, 0.5f ); m_callstackBuzzAnim.Enable( bidx, 0.5f );
} }
@ -12869,11 +12850,7 @@ void View::DrawLockInfoWindow()
ImGui::Text( "%s:%i", fileName, srcloc.line ); ImGui::Text( "%s:%i", fileName, srcloc.line );
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{ {
if( SourceFileValid( fileName, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( fileName, srcloc.line, 0 ) )
{
SetTextEditorFile( fileName, srcloc.line, 0 );
}
else
{ {
m_lockInfoAnim.Enable( m_lockInfoWindow, 0.5f ); m_lockInfoAnim.Enable( m_lockInfoWindow, 0.5f );
} }
@ -13444,12 +13421,9 @@ void View::DrawSampleParents()
ImGui::TextUnformatted( callFile ); ImGui::TextUnformatted( callFile );
} }
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{
if( SourceFileValid( callFile, m_worker.GetCaptureTime() ) )
{ {
SetTextEditorFile( callFile, symbol->callLine, m_sampleParents.symAddr ); SetTextEditorFile( callFile, symbol->callLine, m_sampleParents.symAddr );
} }
}
TextDisabledUnformatted( "Entry point:" ); TextDisabledUnformatted( "Entry point:" );
ImGui::SameLine(); ImGui::SameLine();
const auto file = m_worker.GetString( symbol->file ); const auto file = m_worker.GetString( symbol->file );
@ -13462,12 +13436,9 @@ void View::DrawSampleParents()
ImGui::TextUnformatted( file ); ImGui::TextUnformatted( file );
} }
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{
if( SourceFileValid( file, m_worker.GetCaptureTime() ) )
{ {
SetTextEditorFile( file, symbol->line, m_sampleParents.symAddr ); SetTextEditorFile( file, symbol->line, m_sampleParents.symAddr );
} }
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
ImGui::SameLine(); ImGui::SameLine();
@ -13672,11 +13643,7 @@ void View::DrawSampleParents()
if( sym ) if( sym )
{ {
const auto symtxt = m_worker.GetString( sym->file ); const auto symtxt = m_worker.GetString( sym->file );
if( SourceFileValid( symtxt, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( symtxt, sym->line, frame.symAddr ) )
{
SetTextEditorFile( symtxt, sym->line, 0 );
}
else
{ {
m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); m_sampleParentBuzzAnim.Enable( bidx, 0.5f );
} }
@ -13688,11 +13655,7 @@ void View::DrawSampleParents()
} }
else else
{ {
if( SourceFileValid( txt, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( txt, frame.line, frame.symAddr ) )
{
SetTextEditorFile( txt, frame.line, 0 );
}
else
{ {
m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); m_sampleParentBuzzAnim.Enable( bidx, 0.5f );
} }
@ -14665,11 +14628,7 @@ void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrame
ImGui::TextDisabled( "%s:%i", fileName, frame.line ); ImGui::TextDisabled( "%s:%i", fileName, frame.line );
if( ImGui::IsItemClicked( 1 ) ) if( ImGui::IsItemClicked( 1 ) )
{ {
if( SourceFileValid( fileName, m_worker.GetCaptureTime() ) ) if( !SetTextEditorFile( fileName, frame.line, frame.symAddr ) )
{
SetTextEditorFile( fileName, frame.line, 0 );
}
else
{ {
m_callstackTreeBuzzAnim.Enable( idx, 0.5f ); m_callstackTreeBuzzAnim.Enable( idx, 0.5f );
} }