Uploaded November 2025 | Updated September 2026, 2 weeks ago
cppcon.org
---
The Hidden Power of C++23 std::stacktrace for Faster Debugging & Exception Handling - Erez Strauss - CppCon 2025
---
This presentation explores a novel approach to exception handling and debugging in C++23. We introduce a method to capture the full stacktrace the throw statement without changes to the code and with minimal overhead. This method provides the developers with valuable insights into the origin and context of exceptions. It is solving the questions C++ developers face who threw this exception and why, and so makes debugging faster and simpler.
We will present a detailed analysis of the challenges faced in capturing stacktrace information from the throw location, as opposed to the conventional approach of relying solely on the catch statement. Our solution addresses these challenges by introducing per-thread control and capture capabilities, allowing developers to selectively enable or disable stacktrace capture on a per-thread basis. Additionally, we will discuss techniques for differentiating between throw statements used for error handling and those used for flow control, enabling more fine-grained control over exception handling.
The presentation will delve into the technical details of capturing and formatting stacktrace for logging purposes, highlighting the differences between production and development environments. We will demonstrate how this mechanism integrates with the <stacktrace> header introduced in C++23, leveraging its capabilities to capture and format stacktraces efficiently, even across different threads.
Throughout the presentation, demonstrating how the proposed solution simplifies the debugging process and provides an efficient approach that can be seamlessly integrated into production code. We will also discuss the impact of these exception handling techniques when used in conjunction with coroutines, highlighting the potential benefits for asynchronous programming.
To enhance the adaptability of this solution, we will introduce a shared library that can be used as a LD_PRELOAD module. This library extends the capabilities of our exception handling mechanism to external libraries, without changes to the source code.
All code, documentation and presentation materials will be available on github. Attendees will gain insights into this cutting-edge mechanism based on C++23 stacktrace and exception handling, simplifying debugging of both your own code and external libraries. The presentation provides a comprehensive understanding of this new mechanism, its implementation, and its potential impact on writing maintainable and efficient C++ code.
---
Slides: github.com/CppCon/CppCon2025/blob/main/Presentations/Enhancing_Exception_Handling_and_Debugging_Using_Cpp23.pdf
Work at Hudson River Trading (HRT): tinyurl.com/safxfctf
---
Erez Strauss
Erez Strauss worked in Banks and Hedge Funds while focused on low latency systems.
---
CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - cppcon.org
linkedin.com/company/cppcon
https://x.com/cppcon
facebook.com/CppConference
reddit.com/r/cppcon
https://mastodon.social/@CppCon
---
Videos Filmed & Edited by Bash Films: BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
#cpp #cplusplus #programming #coding #softwareengineering
cppcon.org
---
The Hidden Power of C++23 std::stacktrace for Faster Debugging & Exception Handling - Erez Strauss - CppCon 2025
---
This presentation explores a novel approach to exception handling and debugging in C++23. We introduce a method to capture the full stacktrace the throw statement without changes to the code and with minimal overhead. This method provides the developers with valuable insights into the origin and context of exceptions. It is solving the questions C++ developers face who threw this exception and why, and so makes debugging faster and simpler.
We will present a detailed analysis of the challenges faced in capturing stacktrace information from the throw location, as opposed to the conventional approach of relying solely on the catch statement. Our solution addresses these challenges by introducing per-thread control and capture capabilities, allowing developers to selectively enable or disable stacktrace capture on a per-thread basis. Additionally, we will discuss techniques for differentiating between throw statements used for error handling and those used for flow control, enabling more fine-grained control over exception handling.
The presentation will delve into the technical details of capturing and formatting stacktrace for logging purposes, highlighting the differences between production and development environments. We will demonstrate how this mechanism integrates with the <stacktrace> header introduced in C++23, leveraging its capabilities to capture and format stacktraces efficiently, even across different threads.
Throughout the presentation, demonstrating how the proposed solution simplifies the debugging process and provides an efficient approach that can be seamlessly integrated into production code. We will also discuss the impact of these exception handling techniques when used in conjunction with coroutines, highlighting the potential benefits for asynchronous programming.
To enhance the adaptability of this solution, we will introduce a shared library that can be used as a LD_PRELOAD module. This library extends the capabilities of our exception handling mechanism to external libraries, without changes to the source code.
All code, documentation and presentation materials will be available on github. Attendees will gain insights into this cutting-edge mechanism based on C++23 stacktrace and exception handling, simplifying debugging of both your own code and external libraries. The presentation provides a comprehensive understanding of this new mechanism, its implementation, and its potential impact on writing maintainable and efficient C++ code.
---
Slides: github.com/CppCon/CppCon2025/blob/main/Presentations/Enhancing_Exception_Handling_and_Debugging_Using_Cpp23.pdf
Work at Hudson River Trading (HRT): tinyurl.com/safxfctf
---
Erez Strauss
Erez Strauss worked in Banks and Hedge Funds while focused on low latency systems.
---
CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - cppcon.org
linkedin.com/company/cppcon
https://x.com/cppcon
facebook.com/CppConference
reddit.com/r/cppcon
https://mastodon.social/@CppCon
---
Videos Filmed & Edited by Bash Films: BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
#cpp #cplusplus #programming #coding #softwareengineering










