Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/utilities/elfStringTable.hpp
32285 views
/*1* Copyright (c) 1997, 2012, 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_STRING_TABLE_HPP25#define SHARE_VM_UTILITIES_ELF_STRING_TABLE_HPP2627#if !defined(_WINDOWS) && !defined(__APPLE__)2829#include "memory/allocation.hpp"30#include "utilities/decoder.hpp"31#include "utilities/elfFile.hpp"323334// The string table represents a string table section in an elf file.35// Whenever there is enough memory, it will load whole string table as36// one blob. Otherwise, it will load string from file when requested.37class ElfStringTable: CHeapObj<mtInternal> {38friend class ElfFile;39public:40ElfStringTable(FILE* file, Elf_Shdr shdr, int index);41~ElfStringTable();4243// section index44int index() { return m_index; };4546// get string at specified offset47bool string_at(int offset, char* buf, int buflen);4849// get status code50NullDecoder::decoder_status get_status() { return m_status; };5152protected:53ElfStringTable* m_next;5455// section index56int m_index;5758// holds complete string table if can59// allocate enough memory60const char* m_table;6162// file contains string table63FILE* m_file;6465// section header66Elf_Shdr m_shdr;6768// error code69NullDecoder::decoder_status m_status;70};7172#endif // !_WINDOWS && !__APPLE__7374#endif // SHARE_VM_UTILITIES_ELF_STRING_TABLE_HPP757677