-/* Copyright (c) 2005-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/internal_config.h"
-extern "C" {
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_backtrace, xbt, "Backtrace");
-}
-
static bool startWith(std::string str, const char* prefix)
{
return strncmp(str.c_str(), prefix, strlen(prefix)) == 0;
void xbt_backtrace_display(xbt_backtrace_location_t* loc, std::size_t count)
{
#ifdef HAVE_BACKTRACE
- std::vector<std::string> backtrace = simgrid::xbt::resolveBacktrace(loc, count);
+ std::vector<std::string> backtrace = simgrid::xbt::resolve_backtrace(loc, count);
if (backtrace.empty()) {
fprintf(stderr, "(backtrace not set)\n");
return;
return std::unique_ptr<char, void(*)(void*)>(xbt_strdup(name), std::free);
}
-std::vector<xbt_backtrace_location_t> backtrace()
+Backtrace backtrace()
{
const std::size_t size = 10;
xbt_backtrace_location_t loc[size];
size_t used = xbt_backtrace_current(loc, size);
- return std::vector<xbt_backtrace_location_t>(loc, loc + used);
+ return Backtrace(loc, loc + used);
}
}