28 # ifdef HAVE_EXECINFO_H 29 # include <execinfo.h> 30 # endif // HAVE_EXECINFO_H 31 #endif // GUM_DEBUG_MODE 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 37 const std::string __createMsg(
const std::string& filename,
38 const std::string&
function,
40 const std::string& msg) {
41 std::stringstream stream;
43 stream << std::endl << msg << std::endl;
46 <<
"<" << filename <<
"> " <<
function <<
"() #" << std::setw(6)
47 << std::dec << line <<
" :" << std::endl
48 <<
"--------------" << std::endl
49 <<
"! " << msg << std::endl
50 <<
"--------------" << std::endl;
57 _msg(aMsg), _type(aType) {
58 # ifdef GUM_DEBUG_MODE 59 # ifdef HAVE_EXECINFO_H 60 # define callStackDepth 20 61 void* array[callStackDepth];
64 size = backtrace(array, callStackDepth);
65 strings = backtrace_symbols(array, size);
67 std::stringstream stream;
69 for (
size_t i = 1; i < size; ++i) {
70 stream << i <<
" :" << strings[i] << std::endl;
74 _callstack = stream.str();
75 # else // HAVE_EXECINFO_H 76 _callstack =
"Callstack only in linux debug mode when execinfo.h available";
77 # endif // HAVE_EXECINFO_H 78 # else // GUM_DEBUG_MODE 79 _callstack =
"Callstack only in linux debug mod ewhen execinfo.h available";
80 # endif // GUM_DEBUG_MODE 85 #endif // DOXYGEN_SHOULD_SKIP_THIS
gum is the global namespace for all aGrUM entities
Exception(const std::string aMsg="", const std::string aType="Generic error")