src/share/vm/utilities/elfFile.hpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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. --- 1,7 ---- /* ! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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.
*** 20,31 **** * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef __ELF_FILE_HPP ! #define __ELF_FILE_HPP #if !defined(_WINDOWS) && !defined(__APPLE__) #if defined(__OpenBSD__) #include <sys/exec_elf.h> --- 20,31 ---- * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_VM_UTILITIES_ELF_FILE_HPP ! #define SHARE_VM_UTILITIES_ELF_FILE_HPP #if !defined(_WINDOWS) && !defined(__APPLE__) #if defined(__OpenBSD__) #include <sys/exec_elf.h>
*** 81,96 **** // Beware, this code is called from vm error reporting code, when vm is already // in "error" state, so there are scenarios, lookup will fail. We want this // part of code to be very defensive, and bait out if anything went wrong. class ElfFile: public CHeapObj { ! friend class Decoder; public: ElfFile(const char* filepath); ~ElfFile(); ! const char* decode(address addr, int* offset); const char* filepath() { return m_filepath; } bool same_elf_file(const char* filepath) { --- 81,96 ---- // Beware, this code is called from vm error reporting code, when vm is already // in "error" state, so there are scenarios, lookup will fail. We want this // part of code to be very defensive, and bait out if anything went wrong. class ElfFile: public CHeapObj { ! friend class ElfDecoder; public: ElfFile(const char* filepath); ~ElfFile(); ! bool decode(address addr, char* buf, int buflen, int* offset); const char* filepath() { return m_filepath; } bool same_elf_file(const char* filepath) {
*** 97,107 **** assert(filepath, "null file path"); assert(m_filepath, "already out of memory"); return (m_filepath && !strcmp(filepath, m_filepath)); } ! Decoder::decoder_status get_status() { return m_status; } private: // sanity check, if the file is a real elf file --- 97,107 ---- assert(filepath, "null file path"); assert(m_filepath, "already out of memory"); return (m_filepath && !strcmp(filepath, m_filepath)); } ! NullDecoder::decoder_status get_status() { return m_status; } private: // sanity check, if the file is a real elf file
*** 117,128 **** void add_symbol_table(ElfSymbolTable* table); // return a string table at specified section index ElfStringTable* get_string_table(int index); ! // look up an address and return the nearest symbol ! const char* look_up(Elf_Shdr shdr, address addr, int* offset); protected: ElfFile* m_next; private: --- 117,129 ---- void add_symbol_table(ElfSymbolTable* table); // return a string table at specified section index ElfStringTable* get_string_table(int index); ! protected: ! ElfFile* next() const { return m_next; } ! void set_next(ElfFile* file) { m_next = file; } protected: ElfFile* m_next; private:
*** 137,147 **** ElfSymbolTable* m_symbol_tables; // string tables ElfStringTable* m_string_tables; ! Decoder::decoder_status m_status; }; #endif // _WINDOWS ! #endif // __ELF_FILE_HPP --- 138,148 ---- ElfSymbolTable* m_symbol_tables; // string tables ElfStringTable* m_string_tables; ! NullDecoder::decoder_status m_status; }; #endif // _WINDOWS ! #endif // SHARE_VM_UTILITIES_ELF_FILE_HPP