CF_CrashConfig¶
Category: crash
GitHub: cute_crash.h
What a crash report says about the build, where it goes, and what the reporter watches for.
| Struct Members | Description |
|---|---|
const char* version |
The game's version string. Goes into every report. |
const char* build |
A build label, such as a git sha. Optional; the report carries each module's build id regardless. |
const char* config |
A build configuration label ("Debug", "Release"). Optional. |
const char* report_dir |
Where reports wait on disk. NULL for the platform's per-user app data under the executable's name. |
const char* sym_dir |
Where <module>.sym tables are looked for. NULL for beside each module. Embedded tables are found regardless. |
const char* upload_url |
Full URL of the endpoint reports are POSTed to, e.g. "https://crash.example.com/v1/crash". NULL keeps reports on disk, unsent. |
const char* upload_token |
An optional bearer token sent in the Authorization header. |
CF_CrashMode mode |
See CF_CrashMode. |
bool upload_on_crash |
In-process mode: spawn a child from the crash handler that uploads at once. Otherwise reports upload on the next launch. |
bool minidump |
Windows: write a minidump beside the report, with stacks and the memory they reference, so locals are visible in a debugger. Default true. |
bool install_id |
Include a random per-installation id in reports so a service can count affected users. Default true. |
float hang_seconds |
Seconds without a frame before the main thread is sampled and a hang report is written. 0 (default) turns the watchdog off. CF calls the heartbeat from cf_app_update. |
bool ask_consent |
Ask the player before sending, once, and remember the answer. Default true. |
bool assert_reports |
A failed assert (the CF_ASSERT macro) records its expression, file and line (state.assert, and the last breadcrumb) before the assert handler runs; if the handler returns, the assert is written as a report of its own, with a stack. Default true. |
void (*on_crash)(void* udata) |
Called inside the crash handler before the report is written: the last chance to call cf_crash_set. No allocation, no locks. |
void (*on_hang)(void* udata) |
Called on the watchdog thread after a hang report is written. Default: nothing; the game keeps running and the watchdog keeps watching. |
void* udata |
Passed to the callbacks. |
Remarks¶
Every field has a working default from cf_crash_defaults; a report needs only version and upload_url.
A report holds the stack of the crashing thread as module-relative addresses plus the build id of
every loaded module, the fault, the machine, breadcrumbs (cf_crash_breadcrumb), state
(cf_crash_set), and on Windows a minidump. Reports are JSON files in report_dir. Before upload
they are symbolicated against any symbol table found: embedded in the module (cf_symbols(target EMBED)
in CMake), beside it as <module>.sym, or in sym_dir. Missing tables leave frames raw; the
developer resolves them later with cute-sym resolve and the tables kept from the build.
Related Pages¶
cf_crash_defaults
cf_crash_init
cf_crash_breadcrumb
cf_crash_set