#include <infrastructure.hpp>
The ErrorHandling class containimplements the functionality of displaying the content of error messages (including content of call stack when error happened), and exiting the program.
Definition at line 77 of file infrastructure.hpp.
◆ fatalError() [1/2]
void gadgetlib2::ErrorHandling::fatalError |
( |
const ::std::string & |
msg | ) |
|
|
static |
Definition at line 73 of file infrastructure.cpp.
76 ::std::cerr <<
"ERROR: " << msg << ::std::endl << ::std::endl;
78 throw ::std::runtime_error(msg);
81 const ::std::string releaseMsg(
82 "Fatal error encountered. Run debug build for more"
83 " information and stack trace.");
84 ::std::cerr <<
"ERROR: " << releaseMsg << ::std::endl << ::std::endl;
85 throw ::std::runtime_error(releaseMsg);
◆ fatalError() [2/2]
static void __noreturn gadgetlib2::ErrorHandling::fatalError |
( |
const std::stringstream & |
msg | ) |
|
|
static |
◆ printStacktrace()
void gadgetlib2::ErrorHandling::printStacktrace |
( |
| ) |
|
|
static |
Definition at line 94 of file infrastructure.cpp.
97 std::cerr <<
"Stack trace (pipe through c++filt to demangle identifiers):"
99 const int maxFrames = 100;
100 void *frames[maxFrames];
102 int numFrames = backtrace(frames, maxFrames);
104 backtrace_symbols_fd(frames, numFrames, STDERR_FILENO);
108 std::cerr <<
" (stack trace not available on this platform)" << std::endl;
The documentation for this class was generated from the following files: