A C++ library for generating beautiful, detailed stack traces with source code snippets and inlining information.
Backward-cpp is a C++ library that captures and pretty-prints stack traces when a program crashes or on demand. It solves the problem of cryptic, hard-to-read stack dumps by providing colorized output, source code snippets, and inlining information directly in the terminal. It's designed to integrate seamlessly into C++ projects to improve debugging efficiency.
C++ developers working on applications that need robust crash reporting and debugging, especially those dealing with complex codebases, signal handling, or production environments where post-mortem analysis is critical.
Developers choose Backward-cpp because it turns standard, nearly useless stack traces into richly detailed, human-readable reports without requiring external tools. Its header-only design and automatic signal handling make integration trivial, while support for multiple debug info backends ensures compatibility across systems.
A beautiful stack trace pretty printer for C++
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Installs signal handlers to automatically print detailed stack traces on segfaults, aborts, and unhandled exceptions, eliminating the need for manual backtrace calls in crash scenarios.
When compiled with debug symbols (-g), it displays source code snippets and line numbers around each stack frame, making traces immediately actionable without external tools.
Visualizes compiler-inlined functions directly in the stack trace, which is invaluable for debugging optimized release builds where inlining obscures call paths.
Provides uniform pretty-printed output across Linux, macOS, and Windows, reducing platform-specific debugging hurdles with a single codebase.
For full pretty-printing, it requires linking against external libraries like libbfd, libdw, or libdwarf, adding complexity to the build process and potential portability issues.
The README explicitly warns that its signal handlers are not signal-safe and can deadlock if a crash occurs during malloc, making it risky for multithreaded or high-reliability applications.
Without the -g flag during compilation, it reverts to basic symbol names from backtrace_symbols, losing the source code context that is its main selling point.