]>
git.saurik.com Git - apple/xnu.git/blob - libkern/kxld/kxld_demangle.c
5 /* This demangler is part of the C++ ABI. We don't include it directly from
6 * <cxxabi.h> so that we can avoid using C++ in the kernel linker.
9 __cxa_demangle(const char* __mangled_name
, char* __output_buffer
,
10 size_t* __length
, int* __status
);
14 #include "kxld_demangle.h"
16 /*******************************************************************************
17 *******************************************************************************/
19 kxld_demangle(const char *str
, char **buffer __unused
, size_t *length __unused
)
24 const char *rval
= NULL
;
25 char *demangled
= NULL
;
28 if (!str
) goto finish
;
32 if (!buffer
|| !length
) goto finish
;
34 /* Symbol names in the symbol table have an extra '_' prepended to them,
35 * so we skip the first character to make the demangler happy.
37 demangled
= __cxa_demangle(str
+1, *buffer
, length
, &status
);
38 if (!demangled
|| status
) goto finish
;