hotspot/src/share/vm/utilities/decoder_elf.cpp
changeset 31352 a6ab7217b5cc
parent 22857 2167396cfc83
equal deleted inserted replaced
31351:aae7db185576 31352:a6ab7217b5cc
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    32     delete _opened_elf_files;
    32     delete _opened_elf_files;
    33     _opened_elf_files = NULL;
    33     _opened_elf_files = NULL;
    34   }
    34   }
    35 }
    35 }
    36 
    36 
    37 bool ElfDecoder::decode(address addr, char *buf, int buflen, int* offset, const char* filepath) {
    37 bool ElfDecoder::decode(address addr, char *buf, int buflen, int* offset, const char* filepath, bool demangle_name) {
    38   assert(filepath, "null file path");
    38   assert(filepath, "null file path");
    39   assert(buf != NULL && buflen > 0, "Invalid buffer");
    39   assert(buf != NULL && buflen > 0, "Invalid buffer");
    40   if (has_error()) return false;
    40   if (has_error()) return false;
    41   ElfFile* file = get_elf_file(filepath);
    41   ElfFile* file = get_elf_file(filepath);
    42   if (file == NULL) {
    42   if (file == NULL) {
    44   }
    44   }
    45 
    45 
    46   if (!file->decode(addr, buf, buflen, offset)) {
    46   if (!file->decode(addr, buf, buflen, offset)) {
    47     return false;
    47     return false;
    48   }
    48   }
    49   if (buf[0] != '\0') {
    49   if (demangle_name && (buf[0] != '\0')) {
    50     demangle(buf, buf, buflen);
    50     demangle(buf, buf, buflen);
    51   }
    51   }
    52   return true;
    52   return true;
    53 }
    53 }
    54 
    54