mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Allow copying callstack frames name/file to clipboard.
This commit is contained in:
parent
b8f7a4daac
commit
17194cb591
@ -4826,8 +4826,24 @@ void View::DrawCallstackWindow()
|
|||||||
ImGui::Text( "Frame" );
|
ImGui::Text( "Frame" );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text( "Function" );
|
ImGui::Text( "Function" );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextDisabled( "(?)" );
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
ImGui::Text( "Click on entry to copy it to clipboard." );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text( "Location" );
|
ImGui::Text( "Location" );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextDisabled( "(?)" );
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
ImGui::Text( "Click on entry to copy it to clipboard." );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
|
||||||
int fidx = 0;
|
int fidx = 0;
|
||||||
@ -4840,22 +4856,38 @@ void View::DrawCallstackWindow()
|
|||||||
auto frame = m_worker.GetCallstackFrame( entry );
|
auto frame = m_worker.GetCallstackFrame( entry );
|
||||||
if( !frame )
|
if( !frame )
|
||||||
{
|
{
|
||||||
ImGui::Text( "0x%" PRIX64, entry );
|
char buf[32];
|
||||||
|
sprintf( buf, "%p", (void*)entry );
|
||||||
|
ImGui::Text( "%s", buf );
|
||||||
|
if( ImGui::IsItemClicked() )
|
||||||
|
{
|
||||||
|
ImGui::SetClipboardText( buf );
|
||||||
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui::TextWrapped( "%s", m_worker.GetString( frame->name ) );
|
auto txt = m_worker.GetString( frame->name );
|
||||||
|
ImGui::TextWrapped( "%s", txt );
|
||||||
|
if( ImGui::IsItemClicked() )
|
||||||
|
{
|
||||||
|
ImGui::SetClipboardText( txt );
|
||||||
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::PushTextWrapPos( 0.0f );
|
ImGui::PushTextWrapPos( 0.0f );
|
||||||
|
txt = m_worker.GetString( frame->file );
|
||||||
if( frame->line == 0 )
|
if( frame->line == 0 )
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled( "%s", m_worker.GetString( frame->file ) );
|
ImGui::TextDisabled( "%s", txt );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled( "%s:%i", m_worker.GetString( frame->file ), frame->line );
|
ImGui::TextDisabled( "%s:%i", txt, frame->line );
|
||||||
|
}
|
||||||
|
if( ImGui::IsItemClicked() )
|
||||||
|
{
|
||||||
|
ImGui::SetClipboardText( txt );
|
||||||
}
|
}
|
||||||
ImGui::PopTextWrapPos();
|
ImGui::PopTextWrapPos();
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user