From 292db6fdbc8334ebefc244482e665bbd6d421242 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 30 Jun 2005 21:03:25 +0000 Subject: [PATCH] Pretty print stack frames. git-svn-id: https://svn.dealii.org/trunk@11018 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/exceptions.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/deal.II/base/source/exceptions.cc b/deal.II/base/source/exceptions.cc index 88e2e02c88..8b2a611b28 100644 --- a/deal.II/base/source/exceptions.cc +++ b/deal.II/base/source/exceptions.cc @@ -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) -- 2.39.5