mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Differentiate between symbol and base address.
This commit is contained in:
parent
992f4c8c2d
commit
720ed0460b
@ -33,11 +33,12 @@ SourceView::~SourceView()
|
|||||||
delete[] m_data;
|
delete[] m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SourceView::Open( const char* fileName, int line, uint64_t symAddr, const Worker& worker )
|
void SourceView::Open( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr, const Worker& worker )
|
||||||
{
|
{
|
||||||
m_targetLine = line;
|
m_targetLine = line;
|
||||||
m_selectedLine = line;
|
m_selectedLine = line;
|
||||||
m_targetAddr = symAddr;
|
m_targetAddr = symAddr;
|
||||||
|
m_baseAddr = baseAddr;
|
||||||
m_symAddr = symAddr;
|
m_symAddr = symAddr;
|
||||||
|
|
||||||
if( m_file != fileName )
|
if( m_file != fileName )
|
||||||
@ -83,7 +84,7 @@ void SourceView::Open( const char* fileName, int line, uint64_t symAddr, const W
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( m_lines.empty() ) m_showAsm = true;
|
if( m_lines.empty() ) m_showAsm = true;
|
||||||
if( !Disassemble( symAddr, worker ) ) m_showAsm = false;
|
if( !Disassemble( baseAddr, worker ) ) m_showAsm = false;
|
||||||
assert( m_showAsm || !m_lines.empty() );
|
assert( m_showAsm || !m_lines.empty() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
SourceView( ImFont* font );
|
SourceView( ImFont* font );
|
||||||
~SourceView();
|
~SourceView();
|
||||||
|
|
||||||
void Open( const char* fileName, int line, uint64_t symAddr, const Worker& worker );
|
void Open( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr, const Worker& worker );
|
||||||
void Render( const Worker& worker );
|
void Render( const Worker& worker );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -39,6 +39,7 @@ private:
|
|||||||
ImFont* m_font;
|
ImFont* m_font;
|
||||||
const char* m_file;
|
const char* m_file;
|
||||||
uint64_t m_symAddr;
|
uint64_t m_symAddr;
|
||||||
|
uint64_t m_baseAddr;
|
||||||
uint64_t m_targetAddr;
|
uint64_t m_targetAddr;
|
||||||
char* m_data;
|
char* m_data;
|
||||||
size_t m_dataSize;
|
size_t m_dataSize;
|
||||||
|
@ -192,11 +192,11 @@ void View::InitTextEditor( ImFont* font )
|
|||||||
m_sourceViewFile = nullptr;
|
m_sourceViewFile = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::SetTextEditorFile( const char* fileName, int line, uint64_t symAddr )
|
void View::SetTextEditorFile( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr )
|
||||||
{
|
{
|
||||||
assert( fileName || symAddr );
|
assert( fileName || symAddr );
|
||||||
m_sourceViewFile = fileName ? fileName : (const char*)~uint64_t( 0 );
|
m_sourceViewFile = fileName ? fileName : (const char*)~uint64_t( 0 );
|
||||||
m_sourceView->Open( fileName, line, symAddr, m_worker );
|
m_sourceView->Open( fileName, line, baseAddr, symAddr, m_worker );
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* View::ShortenNamespace( const char* name ) const
|
const char* View::ShortenNamespace( const char* name ) const
|
||||||
|
@ -80,7 +80,8 @@ public:
|
|||||||
static bool Draw();
|
static bool Draw();
|
||||||
|
|
||||||
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 symAddr );
|
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 ); }
|
||||||
|
|
||||||
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(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user