Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Display errno on error.
[simgrid.git] / src / xbt / backtrace_linux.cpp
index 5df45b9..80de20a 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;
 
@@ -187,9 +191,7 @@ std::vector<std::string> resolveBacktrace(
 
   XBT_VERB("Fire a first command: '%s'", cmd.c_str());
   FILE* pipe = popen(cmd.c_str(), "r");
-  if (not pipe) {
-    xbt_die("Cannot fork addr2line to display the backtrace");
-  }
+  xbt_assert(pipe, "Cannot fork addr2line to display the backtrace");
 
   /* To read the output of addr2line */
   char line_func[1024];
@@ -286,7 +288,7 @@ std::vector<std::string> resolveBacktrace(
 
         /* Here we go, fire an addr2line up */
         std::string subcmd = std::string(ADDR2LINE) + " -f -e " + p + " " + addrs[i];
-        XBT_VERB("Fire a new command: '%s'", subcmd.c_str());
+        XBT_VERB("Fire another command: '%s'", subcmd.c_str());
         FILE* subpipe = popen(subcmd.c_str(), "r");
         if (not subpipe) {
           xbt_die("Cannot fork addr2line to display the backtrace");