Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/utilities/elfSymbolTable.hpp
32285 views
/*1* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP25#define SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP2627#if !defined(_WINDOWS) && !defined(__APPLE__)282930#include "memory/allocation.hpp"31#include "utilities/decoder.hpp"32#include "utilities/elfFile.hpp"3334/*35* symbol table object represents a symbol section in an elf file.36* Whenever possible, it will load all symbols from the corresponding section37* of the elf file into memory. Otherwise, it will walk the section in file38* to look up the symbol that nearest the given address.39*/40class ElfSymbolTable: public CHeapObj<mtInternal> {41friend class ElfFile;42public:43ElfSymbolTable(FILE* file, Elf_Shdr shdr);44~ElfSymbolTable();4546// search the symbol that is nearest to the specified address.47bool lookup(address addr, int* stringtableIndex, int* posIndex, int* offset, ElfFuncDescTable* funcDescTable);4849NullDecoder::decoder_status get_status() { return m_status; };5051protected:52ElfSymbolTable* m_next;5354// holds a complete symbol table section if55// can allocate enough memory56Elf_Sym* m_symbols;5758// file contains string table59FILE* m_file;6061// section header62Elf_Shdr m_shdr;6364NullDecoder::decoder_status m_status;65};6667#endif // !_WINDOWS and !__APPLE__6869#endif // SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP707172