31 # ifdef HAVE_EXECINFO_H 32 # include <execinfo.h> 33 # endif // HAVE_EXECINFO_H 34 #endif // GUM_DEBUG_MODE 37 #ifndef DOXYGEN_SHOULD_SKIP_THIS 40 const std::string __createMsg(
const std::string& filename,
41 const std::string&
function,
43 const std::string& msg) {
44 std::stringstream stream;
46 stream << std::endl << msg << std::endl;
49 <<
"<" << filename <<
"> " <<
function <<
"() #" << std::setw(6)
50 << std::dec << line <<
" :" << std::endl
51 <<
"--------------" << std::endl
52 <<
"! " << msg << std::endl
53 <<
"--------------" << std::endl;
60 _msg(aMsg), _type(aType) {
61 # ifdef GUM_DEBUG_MODE 62 # ifdef HAVE_EXECINFO_H 63 # define callStackDepth 20 64 void* array[callStackDepth];
67 size = backtrace(array, callStackDepth);
68 strings = backtrace_symbols(array, size);
70 std::stringstream stream;
72 for (
size_t i = 1; i < size; ++i) {
73 stream << i <<
" :" << strings[i] << std::endl;
77 _callstack = stream.str();
78 # else // HAVE_EXECINFO_H 79 _callstack =
"Callstack only in linux debug mode when execinfo.h available";
80 # endif // HAVE_EXECINFO_H 81 # else // GUM_DEBUG_MODE 82 _callstack =
"Callstack only in linux debug mod ewhen execinfo.h available";
83 # endif // GUM_DEBUG_MODE 88 #endif // DOXYGEN_SHOULD_SKIP_THIS
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Exception(const std::string aMsg="", const std::string aType="Generic error")