mirror of
https://github.com/wolfpld/tracy.git
synced 2024-12-02 09:44:35 +00:00
Display source location of symbol functions.
This commit is contained in:
parent
dc2ac4e4b3
commit
81de0a3a75
@ -1167,30 +1167,33 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
|
|||||||
}
|
}
|
||||||
auto isym = worker.GetSymbolData( v.first );
|
auto isym = worker.GetSymbolData( v.first );
|
||||||
assert( isym );
|
assert( isym );
|
||||||
|
const char* file;
|
||||||
|
uint32_t line;
|
||||||
|
if( isym->isInline )
|
||||||
|
{
|
||||||
|
file = worker.GetString( isym->callFile );
|
||||||
|
line = isym->callLine;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = worker.GetString( isym->file );
|
||||||
|
line = isym->line;
|
||||||
|
}
|
||||||
ImGui::PushID( v.first );
|
ImGui::PushID( v.first );
|
||||||
const auto symName = v.first == m_baseAddr ? "[ - self - ]" : worker.GetString( isym->name );
|
const auto symName = v.first == m_baseAddr ? "[ - self - ]" : worker.GetString( isym->name );
|
||||||
if( ImGui::Selectable( symName, v.first == m_symAddr, ImGuiSelectableFlags_SpanAllColumns ) )
|
if( ImGui::Selectable( symName, v.first == m_symAddr, ImGuiSelectableFlags_SpanAllColumns ) )
|
||||||
{
|
{
|
||||||
m_symAddr = v.first;
|
m_symAddr = v.first;
|
||||||
const auto sym = worker.GetSymbolData( v.first );
|
|
||||||
const char* file;
|
|
||||||
uint32_t line;
|
|
||||||
if( sym->isInline )
|
|
||||||
{
|
|
||||||
file = worker.GetString( sym->callFile );
|
|
||||||
line = sym->callLine;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
file = worker.GetString( sym->file );
|
|
||||||
line = sym->line;
|
|
||||||
}
|
|
||||||
ParseSource( file, worker, view );
|
ParseSource( file, worker, view );
|
||||||
m_targetLine = line;
|
m_targetLine = line;
|
||||||
SelectLine( line, &worker, true );
|
SelectLine( line, &worker, true );
|
||||||
SelectViewMode();
|
SelectViewMode();
|
||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextDisabled( "%s:%i", file, line );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::TextDisabled( "0x%" PRIx64, v.first );
|
ImGui::TextDisabled( "0x%" PRIx64, v.first );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
Loading…
Reference in New Issue
Block a user