Display crash information in info window.

This commit is contained in:
Bartosz Taudul 2018-08-20 02:23:29 +02:00
parent 2a696418cd
commit 619fba41ab
2 changed files with 45 additions and 0 deletions

View File

@ -6265,6 +6265,49 @@ void View::DrawInfo()
TextFocused( "Count:", RealToString( m_frames->frames.size(), true ) );
ImGui::Separator();
TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );
auto& crash = m_worker.GetCrashEvent();
if( crash.thread != 0 )
{
ImGui::Separator();
#ifdef TRACY_EXTENDED_FONT
ImGui::TextColored( ImVec4( 1.f, 0.2f, 0.2f, 1.f ), ICON_FA_SKULL " Application has crashed. " ICON_FA_SKULL );
#else
ImGui::TextColored( ImVec4( 1.f, 0.2f, 0.2f, 1.f ), "Application has crashed." );
#endif
TextFocused( "Time of crash:", TimeToString( crash.time - m_worker.GetTimeBegin() ) );
TextFocused( "Thread:", m_worker.GetThreadString( crash.thread ) );
ImGui::SameLine();
ImGui::TextDisabled( "(0x%" PRIX64 ")", crash.thread );
ImGui::TextDisabled( "Reason:" );
ImGui::SameLine();
ImGui::TextWrapped( "%s", m_worker.GetString( crash.message ) );
if( crash.callstack != 0 )
{
bool hilite = m_callstackInfoWindow == crash.callstack;
if( hilite )
{
ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.f, 0.6f, 0.6f ) );
ImGui::PushStyleColor( ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV( 0.f, 0.7f, 0.7f ) );
ImGui::PushStyleColor( ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV( 0.f, 0.8f, 0.8f ) );
}
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_ALIGN_JUSTIFY " Call stack" ) )
#else
if( ImGui::Button( "Call stack" ) )
#endif
{
m_callstackInfoWindow = crash.callstack;
}
if( hilite )
{
ImGui::PopStyleColor( 3 );
}
if( ImGui::IsItemHovered() )
{
CallstackTooltip( crash.callstack );
}
}
}
ImGui::End();
}

View File

@ -210,6 +210,8 @@ public:
const VarArray<uint64_t>& GetCallstack( uint32_t idx ) const { return *m_data.callstackPayload[idx]; }
const CallstackFrame* GetCallstackFrame( uint64_t ptr ) const;
const CrashEvent& GetCrashEvent() const { return m_data.m_crashEvent; }
// Some zones may have incomplete timing data (only start time is available, end hasn't arrived yet).
// GetZoneEnd() will try to infer the end time by looking at child zones (parent zone can't end
// before its children have ended).