mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Search for base address when if symbol address is inlined.
This commit is contained in:
parent
4b78559228
commit
45b8622bc9
@ -199,6 +199,33 @@ void View::SetTextEditorFile( const char* fileName, int line, uint64_t baseAddr,
|
||||
m_sourceView->Open( fileName, line, baseAddr, symAddr, m_worker );
|
||||
}
|
||||
|
||||
void View::SetTextEditorFile( const char* fileName, int line, uint64_t symAddr )
|
||||
{
|
||||
if( symAddr == 0 )
|
||||
{
|
||||
SetTextEditorFile( fileName, line, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& symMap = m_worker.GetSymbolMap();
|
||||
auto sit = symMap.find( symAddr );
|
||||
auto baseAddr = symAddr;
|
||||
uint32_t symlen = 0;
|
||||
if( sit != symMap.end() ) symlen = sit->second.size.Val();
|
||||
if( symlen == 0 )
|
||||
{
|
||||
uint32_t offset;
|
||||
const auto parentAddr = m_worker.GetSymbolForAddress( symAddr, offset );
|
||||
if( parentAddr != 0 )
|
||||
{
|
||||
auto pit = symMap.find( parentAddr );
|
||||
if( pit != symMap.end() ) baseAddr = parentAddr;
|
||||
}
|
||||
}
|
||||
SetTextEditorFile( fileName, line, baseAddr, symAddr );
|
||||
}
|
||||
}
|
||||
|
||||
const char* View::ShortenNamespace( const char* name ) const
|
||||
{
|
||||
if( m_namespace == Namespace::Full ) return name;
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
|
||||
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 symAddr ) { SetTextEditorFile( fileName, line, symAddr, symAddr ); }
|
||||
void SetTextEditorFile( const char* fileName, int line, uint64_t symAddr );
|
||||
|
||||
bool ReconnectRequested() const { return m_reconnectRequested; }
|
||||
std::string GetAddress() const { return m_worker.GetAddr(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user