libcsdbg  1.28
C++ exception (and generic) stack trace debug library
const i8 * csdbg::util::type_name ( const std::type_info &  inf)
static

Get the demangled name of a type.

Parameters
[in]infthe type info
Returns
the demangled name (heap allocated)
Exceptions
std::bad_alloc
Note
If demangling failed the decorated name is returned

Definition at line 276 of file util.cpp.

References likely.

Referenced by csdbg::object::class_name().

277 {
278  const i8 *nm = inf.name();
279 
280  /* The abi namespace is part of libstdc++ */
281  i8 *retval = abi::__cxa_demangle(nm, NULL, NULL, NULL);
282  if ( likely(retval != NULL) )
283  return retval;
284 
285  retval = new i8[strlen(nm) + 1];
286  strcpy(retval, nm);
287  return retval;
288 }
char i8
8-bit signed integer
Definition: config.hpp:72
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344

+ Here is the caller graph for this function: