Ardour  8.7-15-gadf511264b
debug_utils.h
Go to the documentation of this file.
1 #ifndef AUDIOGRAPHER_DEBUG_UTILS_H
2 #define AUDIOGRAPHER_DEBUG_UTILS_H
3 
4 #include "flag_field.h"
5 
6 #include <cstdlib>
7 #include <string>
8 
9 #ifdef __GNUC__
10 #include <cxxabi.h>
11 #include <cstdlib>
12 #endif
13 
15 
16 namespace AudioGrapher
17 {
18 
21 {
23  template<typename T>
24  static std::string demangled_name (T const & obj)
25  {
26 #ifdef __GNUC__
27  int status;
28  char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status);
29  if (status == 0) {
30  std::string s(res);
31  std::free (res);
32  return s;
33  }
34 #endif
35  return typeid(obj).name();
36  }
37 
39  static std::string process_context_flag_name (FlagField::Flag flag);
40 };
41 
42 } // namespace
43 
44 #endif // AUDIOGRAPHER_DEBUG_UTILS_H
GtkImageIconNameData name
Definition: gtkimage.h:6
Utilities for debugging.
Definition: debug_utils.h:21
static std::string process_context_flag_name(FlagField::Flag flag)
Returns name of ProcessContext::Flag.
static std::string demangled_name(T const &obj)
Returns the demangled name of the object passed as the parameter.
Definition: debug_utils.h:24