| OLD | NEW |
| 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. */ |
| 4 */ | |
| 5 | 4 |
| 6 #include "xray/xray_priv.h" | 5 #include "xray/xray_priv.h" |
| 7 | 6 |
| 8 /* Note name demangling requires linking against libstdc++ */ | 7 /* Note name demangling requires linking against libstdc++ */ |
| 9 /* If your platform does not support __cxa_demangle, re-compile XRay with: */ | 8 /* If your platform does not support __cxa_demangle, re-compile XRay with: */ |
| 10 /* -DXRAY_NO_DEMANGLE */ | 9 /* -DXRAY_NO_DEMANGLE */ |
| 11 | 10 |
| 12 #if !defined(XRAY_NO_DEMANGLE) | 11 #if !defined(XRAY_NO_DEMANGLE) |
| 13 extern | 12 extern |
| 14 char* __cxa_demangle(const char* __mangled_name, char* __output_buffer, | 13 char* __cxa_demangle(const char* __mangled_name, char* __output_buffer, |
| 15 size_t* __length, int* __status); | 14 size_t* __length, int* __status); |
| 16 #endif | 15 #endif |
| 17 | 16 |
| 18 const char* XRayDemangle(char* demangle, size_t size, const char* symbol) { | 17 const char* XRayDemangle(char* demangle, size_t size, const char* symbol) { |
| 19 #if !defined(XRAY_NO_DEMANGLE) | 18 #if !defined(XRAY_NO_DEMANGLE) |
| 20 int stat; | 19 int stat; |
| 21 __cxa_demangle(symbol, demangle, &size, &stat); | 20 __cxa_demangle(symbol, demangle, &size, &stat); |
| 22 if (stat == 0) | 21 if (stat == 0) |
| 23 return demangle; | 22 return demangle; |
| 24 #endif | 23 #endif |
| 25 return symbol; | 24 return symbol; |
| 26 } | 25 } |
| OLD | NEW |