Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / libraries / xray / demangle.c
blobcf3cbc43de849e58b9bbce644d86986296ad3c15
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 #include "xray/xray_priv.h"
7 /* Note name demangling requires linking against libstdc++ */
8 /* If your platform does not support __cxa_demangle, re-compile XRay with: */
9 /* -DXRAY_NO_DEMANGLE */
11 #if !defined(XRAY_NO_DEMANGLE)
12 extern
13 char* __cxa_demangle(const char* __mangled_name, char* __output_buffer,
14 size_t* __length, int* __status);
15 #endif
17 const char* XRayDemangle(char* demangle, size_t size, const char* symbol) {
18 #if !defined(XRAY_NO_DEMANGLE)
19 int stat;
20 __cxa_demangle(symbol, demangle, &size, &stat);
21 if (stat == 0)
22 return demangle;
23 #endif
24 return symbol;