src/hotspot/share/utilities/elfFuncDescTable.hpp
changeset 48975 2c35fd3c5789
parent 47216 71c04702a3d5
child 53244 9807daeb47c4
equal deleted inserted replaced
48974:66173ef5fbbf 48975:2c35fd3c5789
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright (c) 2012, 2013 SAP SE. All rights reserved.
     3  * Copyright (c) 2012, 2013 SAP SE. All rights reserved.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     7  * under the terms of the GNU General Public License version 2 only, as
   114 
   114 
   115 */
   115 */
   116 
   116 
   117 class ElfFuncDescTable: public CHeapObj<mtInternal> {
   117 class ElfFuncDescTable: public CHeapObj<mtInternal> {
   118   friend class ElfFile;
   118   friend class ElfFile;
   119  public:
   119 private:
       
   120   // holds the complete function descriptor section if
       
   121   // we can allocate enough memory
       
   122   ElfSection          _section;
       
   123 
       
   124   // file contains string table
       
   125   FILE* const         _file;
       
   126 
       
   127   // The section index of this function descriptor (i.e. '.opd') section in the ELF file
       
   128   const int           _index;
       
   129 
       
   130   NullDecoder::decoder_status  _status;
       
   131 public:
   120   ElfFuncDescTable(FILE* file, Elf_Shdr shdr, int index);
   132   ElfFuncDescTable(FILE* file, Elf_Shdr shdr, int index);
   121   ~ElfFuncDescTable();
   133   ~ElfFuncDescTable();
   122 
   134 
   123   // return the function address for the function descriptor at 'index' or NULL on error
   135   // return the function address for the function descriptor at 'index' or NULL on error
   124   address lookup(Elf_Word index);
   136   address lookup(Elf_Word index);
   125 
   137 
   126   int get_index() { return m_index; };
   138   int get_index() const { return _index; };
   127 
   139 
   128   NullDecoder::decoder_status get_status() { return m_status; };
   140   NullDecoder::decoder_status get_status() const { return _status; };
   129 
   141 
   130  protected:
   142 private:
   131   // holds the complete function descriptor section if
   143   address* cached_func_descs() const { return (address*)_section.section_data(); }
   132   // we can allocate enough memory
       
   133   address*            m_funcDescs;
       
   134 
       
   135   // file contains string table
       
   136   FILE*               m_file;
       
   137 
       
   138   // section header
       
   139   Elf_Shdr            m_shdr;
       
   140 
       
   141   // The section index of this function descriptor (i.e. '.opd') section in the ELF file
       
   142   int                 m_index;
       
   143 
       
   144   NullDecoder::decoder_status  m_status;
       
   145 };
   144 };
   146 
   145 
   147 #endif // !_WINDOWS && !__APPLE__
   146 #endif // !_WINDOWS && !__APPLE__
   148 
   147 
   149 #endif // SHARE_VM_UTILITIES_ELF_FUNC_DESC_TABLE_HPP
   148 #endif // SHARE_VM_UTILITIES_ELF_FUNC_DESC_TABLE_HPP