Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case xbt/backtrace.hpp
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jun 2018 07:37:36 +0000 (09:37 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jun 2018 07:37:36 +0000 (09:37 +0200)
include/xbt/backtrace.hpp
src/xbt/backtrace.cpp
src/xbt/backtrace_dummy.cpp
src/xbt/backtrace_linux.cpp
src/xbt/exception.cpp

index 754bd5f..ae378b7 100644 (file)
@@ -29,7 +29,8 @@ XBT_PUBLIC std::vector<xbt_backtrace_location_t> backtrace();
  *
  *  Try ro resolve symbols and source code location.
  */
-XBT_PUBLIC std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count);
+XBT_PUBLIC std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count);
+XBT_ATTRIB_DEPRECATED_v323("Please use xbt::resolve_backtrace()") XBT_PUBLIC std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count);
 }
 }
 
index c05076a..0fc1168 100644 (file)
@@ -32,7 +32,7 @@ static bool startWith(std::string str, const char* prefix)
 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;
index 655a4c2..95bf87a 100644 (file)
@@ -23,8 +23,12 @@ int xbt_backtrace_no_malloc(void **array, int size) {
 namespace simgrid {
 namespace xbt {
 
-std::vector<std::string> resolveBacktrace(
-  xbt_backtrace_location_t const* loc, std::size_t count)
+std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count) // deprecated
+{
+  return resolve_backtrace(loc, count);
+}
+
+std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)
 {
   return std::vector<std::string>();
 }
index 5df45b9..3c8ecb3 100644 (file)
@@ -136,10 +136,14 @@ static std::string get_binary_path()
   return "";
 }
 
+std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count) // deprecated
+{
+  return resolve_backtrace(loc, count);
+}
+
 //FIXME: This code could be greatly improved/simplifyied with
 //   http://cairo.sourcearchive.com/documentation/1.9.4/backtrace-symbols_8c-source.html
-std::vector<std::string> resolveBacktrace(
-  xbt_backtrace_location_t const* loc, std::size_t count)
+std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)
 {
   std::vector<std::string> result;
 
index e57759d..ba9bbcf 100644 (file)
@@ -44,8 +44,8 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
 
     // Do we have a backtrace?
     if (with_context != nullptr && not simgrid::config::get_value<bool>("exception/cutpath")) {
-      auto backtrace = simgrid::xbt::resolveBacktrace(
-        with_context->backtrace().data(), with_context->backtrace().size());
+      auto backtrace =
+          simgrid::xbt::resolve_backtrace(with_context->backtrace().data(), with_context->backtrace().size());
       for (std::string const& s : backtrace)
         XBT_LOG(prio, "  -> %s", s.c_str());
     }
@@ -76,7 +76,7 @@ static void showBacktrace(std::vector<xbt_backtrace_location_t>& bt)
     XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
     return;
   }
-  std::vector<std::string> res = resolveBacktrace(&bt[0], bt.size());
+  std::vector<std::string> res = resolve_backtrace(&bt[0], bt.size());
   XBT_LOG(xbt_log_priority_critical, "Current backtrace:");
   for (std::string const& s : res)
     XBT_LOG(xbt_log_priority_critical, "  -> %s", s.c_str());