C++23 introduced the stacktrace library. A stacktrace is represented as a container, with each entry representing one entry in the stackstrace.
Each entry provides a description, source file and line number.
Debug information is not required (at least for GCC).
Compiler Explorer link: https://compiler-explorer.com/z/416r87q8o