Skip to content

Instantly share code, notes, and snippets.

@mintsoft
Created March 10, 2024 09:50
Show Gist options
  • Save mintsoft/9092fcfdf4d0f569b7170e41f00c1894 to your computer and use it in GitHub Desktop.
Save mintsoft/9092fcfdf4d0f569b7170e41f00c1894 to your computer and use it in GitHub Desktop.
qCritical log out a stack trace from boost::stacktrace
#include <boost/stacktrace.hpp>
// .....
auto re_stacktrace = boost::stacktrace::stacktrace();
for(boost::stacktrace::frame frame: re_stacktrace) {
if(frame.empty() == false) {
qCritical("STACK -- %s %s:%d %d", frame.name().c_str(), frame.source_file().c_str(), frame.source_line(), frame.address());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment