CrashCatch¶
๐ฅ A modern, single-header crash reporting library for C++ on Windows and Linux.
---¶
๐ What is CrashCatch?¶
CrashCatch is a modern, single-header crash reporting library for C++ applications โ supporting both Windows and Linux.
It automatically captures crashes, logs diagnostic information, generates .dmp
(Windows) or .txt
(Windows & Linux) reports, and includes stack traces and environment metadata. From minimal CLI tools to full desktop apps, CrashCatch fits right in.
Key highlights:
- No external dependencies โ just include the header
- Full crash context (timestamp, platform, executable path, version, etc.)
- Symbol resolution and demangling (platform-specific)
- Configurable onCrash()
and onCrashUpload()
hooks
- Optional crash dialog support (Windows GUI apps)
As of v1.2.0, CrashCatch offers complete Linux support with signal handling, demangled stack traces, and crash context generation.
โ Supported Platforms¶
OS | Supported | Crash Handling Method |
---|---|---|
Windows | โ Yes | SetUnhandledExceptionFilter + MiniDump |
Linux | โ Yes | POSIX signals (signal() ) + backtrace |
macOS | ๐ง Planned | POSIX + Mach exceptions |
โก Quick Start¶
Zero Config (Auto-init)¶
#define CRASHCATCH_AUTO_INIT
#include "CrashCatch.hpp"
int main() {
int* ptr = nullptr;
*ptr = 42; // simulated crash
}
One-Liner Setup¶
Full Config Example¶
#include "CrashCatch.hpp"
int main() {
CrashCatch::Config config;
config.appVersion = "1.1.0";
config.buildConfig = "Release";
config.additionalNotes = "Test build";
config.showCrashDialog = true;
config.onCrash = [] {
std::cout << "Cleaning up before crash...\n";
};
CrashCatch::initialize(config);
int* ptr = nullptr;
*ptr = 42;
}
๐ฆ Installing with CMake¶
Then in another project:
๐งช Examples¶
Explore working examples in the GitHub repo: - ZeroConfig - OneLiner - FullConfig - ThreadCrash - DivideByZero
๐ธ Screenshots¶
๐ Features¶
- โ
Header-only โ single
.hpp
, no external dependencies - โ Cross-platform โ Windows & Linux support out of the box
- โ
Automatic Crash Capture โ via
SetUnhandledExceptionFilter
(Windows) or POSIX signals (Linux) - โ Crash Context Info โ includes executable path, build config, version, and notes
- โ Crash Reporting:
.dmp
(Windows) or.txt
(Linux/Windows) crash files- Detailed stack traces and environment info
- โ Symbol Resolution:
- Top frame symbols (Windows)
- Demangled symbols (Linux)
- โ onCrash Callback โ run custom cleanup or logging logic with full crash context
- โ Optional Crash Dialog โ user-friendly message box (Windows only)
- โ Configurable Dump Location, filename prefix, and timestamping
- โ onCrashUpload Hook โ pass report data to your custom uploader
- โ CMake + CI Friendly โ drop-in installation and build support
๐ License¶
MIT License โ created and maintained by Keith Pottratz
GitHub Repo
Created by Keith Pottratz
MIT Licensed