comparison src/os/linux/vm/decoder_linux.cpp @ 14441:e7cbc95179c4

8019929: PPC64 (part 107): Extend ELF-decoder to support PPC64 function descriptor tables Summary: Extend ELF-decoder to support PPC64 function descriptor tables Reviewed-by: kvn, zgu
author simonis
date Thu, 05 Dec 2013 19:19:09 +0100
parents b9a9ed0f8eeb
children 4ca6dc0799b6
comparison
equal deleted inserted replaced
14440:41b780b43b74 14441:e7cbc95179c4
30 bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) { 30 bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) {
31 int status; 31 int status;
32 char* result; 32 char* result;
33 size_t size = (size_t)buflen; 33 size_t size = (size_t)buflen;
34 34
35 #ifdef PPC64
36 // On PPC64 ElfDecoder::decode() may return a dot (.) prefixed name
37 // (see elfFuncDescTable.hpp for details)
38 if (symbol && *symbol == '.') symbol += 1;
39 #endif
40
35 // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small, 41 // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small,
36 // __cxa_demangle will call system "realloc" for additional memory, which 42 // __cxa_demangle will call system "realloc" for additional memory, which
37 // may use different malloc/realloc mechanism that allocates 'buf'. 43 // may use different malloc/realloc mechanism that allocates 'buf'.
38 if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) { 44 if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) {
39 jio_snprintf(buf, buflen, "%s", result); 45 jio_snprintf(buf, buflen, "%s", result);