Check for asm/source availability in SetTextEditorFile.

This commit is contained in:
Bartosz Taudul 2020-03-27 21:30:16 +01:00
parent efbf13fcd4
commit 78ea40d70c
2 changed files with 26 additions and 4 deletions

View File

@ -199,11 +199,28 @@ void View::SetTextEditorFile( const char* fileName, int line, uint64_t baseAddr,
m_sourceView->Open( fileName, line, baseAddr, symAddr, m_worker ); m_sourceView->Open( fileName, line, baseAddr, symAddr, m_worker );
} }
void View::SetTextEditorFile( const char* fileName, int line, uint64_t symAddr ) bool View::SetTextEditorFile( const char* fileName, int line, uint64_t symAddr )
{ {
if( line == 0 )
{
fileName = nullptr;
}
else
{
if( !SourceFileValid( fileName, m_worker.GetCaptureTime() ) )
{
fileName = nullptr;
line = 0;
}
}
if( symAddr == 0 ) if( symAddr == 0 )
{ {
SetTextEditorFile( fileName, line, 0, 0 ); if( line != 0 )
{
SetTextEditorFile( fileName, line, 0, 0 );
return true;
}
return false;
} }
else else
{ {
@ -222,7 +239,12 @@ void View::SetTextEditorFile( const char* fileName, int line, uint64_t symAddr )
if( pit != symMap.end() ) baseAddr = parentAddr; if( pit != symMap.end() ) baseAddr = parentAddr;
} }
} }
SetTextEditorFile( fileName, line, baseAddr, symAddr ); if( symlen != 0 || line != 0 )
{
SetTextEditorFile( fileName, line, baseAddr, symAddr );
return true;
}
return false;
} }
} }

View File

@ -81,7 +81,7 @@ public:
void NotifyRootWindowSize( float w, float h ) { m_rootWidth = w; m_rootHeight = h; } void NotifyRootWindowSize( float w, float h ) { m_rootWidth = w; m_rootHeight = h; }
void SetTextEditorFile( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr ); void SetTextEditorFile( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr );
void SetTextEditorFile( const char* fileName, int line, uint64_t symAddr ); bool SetTextEditorFile( const char* fileName, int line, uint64_t symAddr );
bool ReconnectRequested() const { return m_reconnectRequested; } bool ReconnectRequested() const { return m_reconnectRequested; }
std::string GetAddress() const { return m_worker.GetAddr(); } std::string GetAddress() const { return m_worker.GetAddr(); }