#include #ifdef WIN32 #include #include #endif #include "GLTB/exception.h" namespace gltb { std::string Exception::asFormattedText() { std::ostringstream output; output << "Exception: " << getDescription() << std::endl; output << "In: " << getLocation(); return output.str(); } #if defined LINUX TraceableException::TraceableException(std::string description, std::string location) : Exception(description, location) { exceptionTrace=new void*[300]; exceptionTraceSize=backtrace(exceptionTrace,300); }; TraceableException::~TraceableException() { delete[] exceptionTrace; } std::string TraceableException::getBacktrace() { std::string result; char **backtraceSymbols=backtrace_symbols(exceptionTrace,exceptionTraceSize); for(int i=0;i