decoder_elf.hpp 1.9 KB
Newer Older
N
never 已提交
1
/*
Z
zgu 已提交
2
 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
N
never 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */

Z
zgu 已提交
25 26
#ifndef SHARE_VM_UTILITIES_DECODER_ELF_HPP
#define SHARE_VM_UTILITIES_DECODER_ELF_HPP
N
never 已提交
27

Z
zgu 已提交
28
#if !defined(_WINDOWS) && !defined(__APPLE__)
N
never 已提交
29

Z
zgu 已提交
30 31
#include "utilities/decoder.hpp"
#include "utilities/elfFile.hpp"
N
never 已提交
32

Z
zgu 已提交
33
class ElfDecoder : public AbstractDecoder {
N
never 已提交
34

Z
zgu 已提交
35 36 37 38 39 40
public:
  ElfDecoder() {
    _opened_elf_files = NULL;
    _decoder_status = no_error;
  }
  ~ElfDecoder();
N
never 已提交
41

Z
zgu 已提交
42
  bool can_decode_C_frame_in_vm() const { return true; }
N
never 已提交
43

Z
zgu 已提交
44 45
  bool demangle(const char* symbol, char *buf, int buflen);
  bool decode(address addr, char *buf, int buflen, int* offset, const char* filepath = NULL);
46 47 48 49
  bool decode(address addr, char *buf, int buflen, int* offset, const void *base) {
    ShouldNotReachHere();
    return false;
  }
N
never 已提交
50

Z
zgu 已提交
51 52
private:
  ElfFile*         get_elf_file(const char* filepath);
N
never 已提交
53

Z
zgu 已提交
54 55 56
private:
  ElfFile*         _opened_elf_files;
};
N
never 已提交
57

Z
zgu 已提交
58 59
#endif
#endif // SHARE_VM_UTILITIES_DECODER_ELF_HPP