Add a crash survival achievement.

This commit is contained in:
Bartosz Taudul
2026-11-02 00:59:04 +01:00
parent a6cb6ec3c2
commit 0342049936
4 changed files with 22 additions and 1 deletions
+1
View File
@@ -244,6 +244,7 @@ Embed(PROFILER_FILES TextCompareTraces src/achievements/CompareTraces.md TEXT)
Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT)
Embed(PROFILER_FILES TextSamplingStats src/achievements/SamplingStats.md TEXT)
Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md TEXT)
Embed(PROFILER_FILES TextSurviveCrash src/achievements/SurviveCrash.md TEXT)
Embed(PROFILER_FILES TextZoneCallstacks src/achievements/ZoneCallstacks.md TEXT)
Embed(PROFILER_FILES TextSections src/achievements/Sections.md TEXT)
+12
View File
@@ -0,0 +1,12 @@
# Survive a crash
When the application crashes, Tracy's [crash handler](#crashhandling) intercepts the fault, finishes sending the profiling data, and reports the crash: time, thread, reason, and the call stack at the crash site. Its * Call stack* button opens the stack where the fault occurred, and * Focus* jumps the timeline to the crash point. Crash handling runs automatically on Windows, Linux, and Android.
After you close this report, the crash remains marked on the trace. On the timeline, the crashed thread's label reads * Crashed* in red. The * skull* button in the notification area reopens the crash stack. The Trace information window shows the crash's time, thread, and reason.
> [!TIP]
> **Tip**
>
> The stack resolves into function names only if the profiler can read symbols from your binary, the same [requirement as call stack capture](#collectingcallstacks).
Now crash your application on purpose and read the report.
@@ -41,6 +41,7 @@
#include "data/TextSamplingStats.hpp"
#include "data/TextSections.hpp"
#include "data/TextSaveTrace.hpp"
#include "data/TextSurviveCrash.hpp"
#include "data/TextZoneCallstacks.hpp"
namespace tracy::data
@@ -225,7 +226,13 @@ AchievementItem ai_frameStats = {
.text = Unpack( TextFrameStatistics )
};
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, &ai_lightFlame, &ai_frameStats, nullptr };
AchievementItem ai_surviveCrash = {
.id = "surviveCrash",
.name = "Survive a crash",
.text = Unpack( TextSurviveCrash )
};
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, &ai_lightFlame, &ai_frameStats, &ai_surviveCrash, nullptr };
AchievementItem ai_inspectZone = {
.id = "inspectZone",
+1
View File
@@ -1324,6 +1324,7 @@ bool View::DrawImpl()
if( crash.thread != 0 )
{
m_reactToCrash = false;
if( s_config.achievements ) Achieve( "surviveCrash" );
ImGui::OpenPopup( "Application crashed!" );
}
}