- for (boost::stacktrace::frame frame : st) {
- if (state == 1) {
- if (boost::starts_with(frame.name(), "simgrid::xbt::MainFunction") ||
- boost::starts_with(frame.name(), "simgrid::kernel::context::Context::operator()()"))
+ for (boost::stacktrace::frame const& frame : st) {
+ const std::string frame_name = frame.name();
+ if (print) {
+ if (frame_name.rfind("simgrid::xbt::MainFunction", 0) == 0 ||
+ frame_name.rfind("simgrid::kernel::context::Context::operator()()", 0) == 0)