void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func)
{
- xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func, simgrid::xbt::backtrace(), xbt_procname(), xbt_getpid()),
+ xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid()),
message);
xbt_free(message);
e.category = errcat;
// Do we have a backtrace?
if (with_context != nullptr && not simgrid::config::get_value<bool>("exception/cutpath")) {
- auto backtrace = simgrid::xbt::resolve_backtrace(with_context->throw_point().backtrace_);
- for (std::string const& s : backtrace)
- XBT_LOG(prio, " -> %s", s.c_str());
+ auto backtrace = with_context->resolve_backtrace();
+ XBT_LOG(prio, " -> %s", backtrace.c_str());
}
// Do we have a nested exception?
XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
return;
}
- std::vector<std::string> res = resolve_backtrace(bt);
+ std::string res = bt.resolve();
XBT_LOG(xbt_log_priority_critical, "Current backtrace:");
- for (std::string const& s : res)
- XBT_LOG(xbt_log_priority_critical, " -> %s", s.c_str());
+ XBT_LOG(xbt_log_priority_critical, " -> %s", res.c_str());
}
static std::terminate_handler previous_terminate_handler = nullptr;
// Get the current backtrace and exception
auto e = std::current_exception();
- simgrid::xbt::Backtrace bt = simgrid::xbt::backtrace();
+ simgrid::xbt::Backtrace bt = simgrid::xbt::Backtrace();
try {
std::rethrow_exception(e);
}