preCICE
v3.1.2
Loading...
Searching...
No Matches
src
utils
stacktrace.cpp
Go to the documentation of this file.
1
#include "
stacktrace.hpp
"
2
#include <boost/stacktrace.hpp>
3
#include <
exception
>
4
#include <
sstream
>
5
#include <
string
>
6
7
std::string
getStacktrace
()
8
{
9
std::ostringstream
strm;
10
try
{
11
strm << boost::stacktrace::stacktrace();
12
}
catch
(
const
std::exception
&e) {
13
strm <<
"Stacktrace failed: "
<< e.
what
();
14
}
15
return
strm.
str
();
16
}
std::ostringstream
std::string
exception
sstream
getStacktrace
std::string getStacktrace()
Returns a demangled stack backtrace of the caller function.
Definition
stacktrace.cpp:7
stacktrace.hpp
std::ostringstream::str
T str(T... args)
string
std::exception::what
T what(T... args)