src/share/vm/utilities/elfSymbolTable.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7089790_full Sdiff src/share/vm/utilities

src/share/vm/utilities/elfSymbolTable.hpp

Print this page
rev 2696 : elf fixes


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef __ELF_SYMBOL_TABLE_HPP
  26 #define __ELF_SYMBOL_TABLE_HPP
  27 
  28 #ifndef _WINDOWS
  29 
  30 
  31 #include "memory/allocation.hpp"
  32 #include "utilities/decoder.hpp"
  33 #include "utilities/elfFile.hpp"
  34 
  35 /*
  36  * symbol table object represents a symbol section in an elf file.
  37  * Whenever possible, it will load all symbols from the corresponding section
  38  * of the elf file into memory. Otherwise, it will walk the section in file
  39  * to look up the symbol that nearest the given address.
  40  */
  41 class ElfSymbolTable: public CHeapObj {
  42   friend class ElfFile;
  43  public:
  44   ElfSymbolTable(FILE* file, Elf_Shdr shdr);
  45   ~ElfSymbolTable();
  46 
  47   // search the symbol that is nearest to the specified address.
  48   Decoder::decoder_status lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);


  51 
  52  protected:
  53   ElfSymbolTable*  m_next;
  54 
  55   // holds a complete symbol table section if
  56   // can allocate enough memory
  57   Elf_Sym*            m_symbols;
  58 
  59   // file contains string table
  60   FILE*               m_file;
  61 
  62   // section header
  63   Elf_Shdr            m_shdr;
  64 
  65   Decoder::decoder_status  m_status;
  66 };
  67 
  68 #endif // _WINDOWS
  69 
  70 #endif // __ELF_SYMBOL_TABLE_HPP
  71 
  72 
  73 


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef __ELF_SYMBOL_TABLE_HPP
  26 #define __ELF_SYMBOL_TABLE_HPP
  27 
  28 #if !defined(_WINDOWS) && !defined(__APPLE__)
  29 
  30 
  31 #include "memory/allocation.hpp"
  32 #include "utilities/decoder.hpp"
  33 #include "utilities/elfFile.hpp"
  34 
  35 /*
  36  * symbol table object represents a symbol section in an elf file.
  37  * Whenever possible, it will load all symbols from the corresponding section
  38  * of the elf file into memory. Otherwise, it will walk the section in file
  39  * to look up the symbol that nearest the given address.
  40  */
  41 class ElfSymbolTable: public CHeapObj {
  42   friend class ElfFile;
  43  public:
  44   ElfSymbolTable(FILE* file, Elf_Shdr shdr);
  45   ~ElfSymbolTable();
  46 
  47   // search the symbol that is nearest to the specified address.
  48   Decoder::decoder_status lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);


  51 
  52  protected:
  53   ElfSymbolTable*  m_next;
  54 
  55   // holds a complete symbol table section if
  56   // can allocate enough memory
  57   Elf_Sym*            m_symbols;
  58 
  59   // file contains string table
  60   FILE*               m_file;
  61 
  62   // section header
  63   Elf_Shdr            m_shdr;
  64 
  65   Decoder::decoder_status  m_status;
  66 };
  67 
  68 #endif // _WINDOWS
  69 
  70 #endif // __ELF_SYMBOL_TABLE_HPP



src/share/vm/utilities/elfSymbolTable.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File