annotate src/share/vm/utilities/elfSymbolTable.hpp @ 4834:74d14a44c398

Added tag jdk7u60-b01 for changeset 8fd0e931efa5
author asaha
date Wed, 27 Nov 2013 14:57:31 -0800
parents d7e3846464d0
children de5e8c8a9b87
rev   line source
zgu@1929 1 /*
zgu@3084 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
zgu@1929 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
zgu@1929 4 *
zgu@1929 5 * This code is free software; you can redistribute it and/or modify it
zgu@1929 6 * under the terms of the GNU General Public License version 2 only, as
zgu@1929 7 * published by the Free Software Foundation.
zgu@1929 8 *
zgu@1929 9 * This code is distributed in the hope that it will be useful, but WITHOUT
zgu@1929 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
zgu@1929 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
zgu@1929 12 * version 2 for more details (a copy is included in the LICENSE file that
zgu@1929 13 * accompanied this code).
zgu@1929 14 *
zgu@1929 15 * You should have received a copy of the GNU General Public License version
zgu@1929 16 * 2 along with this work; if not, write to the Free Software Foundation,
zgu@1929 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
zgu@1929 18 *
zgu@1929 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
zgu@1929 20 * or visit www.oracle.com if you need additional information or have any
zgu@1929 21 * questions.
zgu@1929 22 *
zgu@1929 23 */
zgu@1929 24
zgu@3084 25 #ifndef SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP
zgu@3084 26 #define SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP
zgu@1929 27
never@2796 28 #if !defined(_WINDOWS) && !defined(__APPLE__)
zgu@1929 29
zgu@1929 30
zgu@1929 31 #include "memory/allocation.hpp"
zgu@1929 32 #include "utilities/decoder.hpp"
zgu@1929 33 #include "utilities/elfFile.hpp"
zgu@1929 34
zgu@1929 35 /*
zgu@1929 36 * symbol table object represents a symbol section in an elf file.
zgu@1929 37 * Whenever possible, it will load all symbols from the corresponding section
zgu@1929 38 * of the elf file into memory. Otherwise, it will walk the section in file
zgu@1929 39 * to look up the symbol that nearest the given address.
zgu@1929 40 */
zgu@3863 41 class ElfSymbolTable: public CHeapObj<mtInternal> {
zgu@1929 42 friend class ElfFile;
zgu@1929 43 public:
zgu@1929 44 ElfSymbolTable(FILE* file, Elf_Shdr shdr);
zgu@1929 45 ~ElfSymbolTable();
zgu@1929 46
zgu@1929 47 // search the symbol that is nearest to the specified address.
zgu@3084 48 bool lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);
zgu@1929 49
zgu@3084 50 NullDecoder::decoder_status get_status() { return m_status; };
zgu@1929 51
zgu@1929 52 protected:
zgu@1929 53 ElfSymbolTable* m_next;
zgu@1929 54
zgu@1929 55 // holds a complete symbol table section if
zgu@1929 56 // can allocate enough memory
zgu@1929 57 Elf_Sym* m_symbols;
zgu@1929 58
zgu@1929 59 // file contains string table
zgu@1929 60 FILE* m_file;
zgu@1929 61
zgu@1929 62 // section header
zgu@1929 63 Elf_Shdr m_shdr;
zgu@1929 64
zgu@3084 65 NullDecoder::decoder_status m_status;
zgu@1929 66 };
zgu@1929 67
zgu@3084 68 #endif // _WINDOWS and _APPLE
zgu@1929 69
zgu@3084 70 #endif // SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP