mlpack  master
backtrace.hpp
Go to the documentation of this file.
1 
12 #ifndef __MLPACK_CORE_UTIL_BACKTRACE_HPP
13 #define __MLPACK_CORE_UTIL_BACKTRACE_HPP
14 
15 #include <string>
16 #include <vector>
17 
18 namespace mlpack {
19 
46 class Backtrace
47 {
48  public:
55 #ifdef HAS_BFD_DL
56  Backtrace(int maxDepth = 32);
57 #else
58  Backtrace();
59 #endif
62 
63  private:
69  static void GetAddress(int maxDepth);
70 
76  static void DecodeAddress(long address);
77 
79  static void DemangleFunction();
80 
82  struct Frames
83  {
84  void *address;
85  const char* function;
86  const char* file;
87  unsigned line;
88  } static frame;
89 
91  static std::vector<Frames> stack;
92 };
93 
94 }; //namespace mlpack
95 
96 #endif
struct mlpack::Backtrace::Frames frame
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
Backtrace()
Constructor initialize fields and call GetAddress to retrieve addresses for each frame of backtrace...
static std::vector< Frames > stack
A vector for all the backtrace information.
Definition: backtrace.hpp:91
static void DecodeAddress(long address)
Decodes file name, function & line number.
Backtrace datastructure.
Definition: backtrace.hpp:82
static void DemangleFunction()
Demangles function name.
static void GetAddress(int maxDepth)
Gets addresses of each called function from the stack.
std::string ToString()
Returns string of backtrace.
test cpp RESULT_VARIABLE MEX_RESULT_TRASH OUTPUT_VARIABLE MEX_OUTPUT ERROR_VARIABLE MEX_ERROR_TRASH string(REGEX MATCH"Warning: You are using"MEX_WARNING"${MEX_OUTPUT}") if(MEX_WARNING) string(REGEX REPLACE".*using [a-zA-Z]* version \"([0-9.]*)[^\"]*\".*""\\1"OTHER_COMPILER_VERSION"$
Definition: CMakeLists.txt:18
Provides a backtrace.
Definition: backtrace.hpp:46