]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Pretty print stack frames.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 21:03:25 +0000 (21:03 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 21:03:25 +0000 (21:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@11018 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/exceptions.cc

index 88e2e02c8802466ae45ef1efb55ecde8333c570d..8b2a611b282e72e06147444f029462bf0a19d081 100644 (file)
@@ -81,6 +81,14 @@ void ExceptionBase::set_fields (const char* f,
 
 void ExceptionBase::print_stack_trace (std::ostream &out) const
 {
+  if (n_stacktrace_frames == 0)
+    return;
+  
+                                  // if there is a stackframe stored, print it
+  out << std::endl;
+  out << "Stacktrace:" << std::endl
+      << "-----------" << std::endl;
+  
                                    // print the stacktrace. first
                                    // omit all those frames that have
                                    // ExceptionBase or
@@ -91,12 +99,12 @@ void ExceptionBase::print_stack_trace (std::ostream &out) const
                                    // place where the exception was
                                    // triggered
    int frame = 0;
-   while ((frame < n_stacktrace_frames)
-         &&
-         ((std::string(stacktrace[frame]).find ("ExceptionBase") != std::string::npos)
-          ||
-          (std::string(stacktrace[frame]).find ("deal_II_exceptions") != std::string::npos)))
-     ++frame;
+//    while ((frame < n_stacktrace_frames)
+//       &&
+//       ((std::string(stacktrace[frame]).find ("ExceptionBase") != std::string::npos)
+//        ||
+//        (std::string(stacktrace[frame]).find ("deal_II_exceptions") != std::string::npos)))
+//      ++frame;
 
                                    // output the rest
    for (; frame < n_stacktrace_frames; ++frame)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.