1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00
libhermit/usr/xray/demangle.c

26 lines
838 B
C
Raw Permalink Normal View History

/* Copyright (c) 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
2016-05-18 00:35:35 +02:00
#include "xray_priv.h"
/* Note name demangling requires linking against libstdc++ */
/* If your platform does not support __cxa_demangle, re-compile XRay with: */
/* -DXRAY_NO_DEMANGLE */
#if !defined(XRAY_NO_DEMANGLE)
extern
char* __cxa_demangle(const char* __mangled_name, char* __output_buffer,
size_t* __length, int* __status);
#endif
const char* XRayDemangle(char* demangle, size_t size, const char* symbol) {
#if !defined(XRAY_NO_DEMANGLE)
int stat;
__cxa_demangle(symbol, demangle, &size, &stat);
if (stat == 0)
return demangle;
#endif
return symbol;
}