]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/BackTrace.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / BackTrace.cc
index 42a8da2aebd1eb2e2a7cd43ce5f830e1e9730b4d..03105d64ad9c1beb5f96baf981682566ec1b30cd 100644 (file)
@@ -11,7 +11,7 @@
 
 namespace ceph {
 
-void BackTrace::print(std::ostream& out) const
+void ClibBackTrace::print(std::ostream& out) const
 {
   out << " " << pretty_version_to_str() << std::endl;
   for (size_t i = skip; i < size; i++) {
@@ -19,7 +19,7 @@ void BackTrace::print(std::ostream& out) const
   }
 }
 
-void BackTrace::dump(Formatter *f) const
+void ClibBackTrace::dump(Formatter *f) const
 {
   f->open_array_section("backtrace");
   for (size_t i = skip; i < size; i++) {
@@ -29,7 +29,7 @@ void BackTrace::dump(Formatter *f) const
   f->close_section();
 }
 
-std::string BackTrace::demangle(const char* name)
+std::string ClibBackTrace::demangle(const char* name)
 {
   // find the parentheses and address offset surrounding the mangled name
 #ifdef __FreeBSD__
@@ -71,4 +71,20 @@ std::string BackTrace::demangle(const char* name)
   }
 }
 
+void PyBackTrace::dump(Formatter *f) const
+{
+  f->open_array_section("backtrace");
+  for (auto& i : strings) {
+    f->dump_string("frame", i);
+  }
+  f->close_section();
+}
+
+void PyBackTrace::print(std::ostream& out) const
+{
+  for (auto& i : strings) {
+    out << i << std::endl;
+  }
+}
+
 }