SymLite-elf.C File Reference

#include "symlite/h/SymLite-elf.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <iostream>

Go to the source code of this file.

Namespaces

namespace  Dyninst

Defines

#define INVALID_SYM_CODE   ((int) 0xffffffff)
#define UNSET_INDEX_CODE   ((int) 0xfffffffe)
#define FOR_EACH_SYMBOL(shdr, symbols, str_buffer, idx)
#define MAKE_SYMBOL(name, idx, shdr, sym)
#define SET_SYM_CACHEINDEX(sym, idx)   sym.i2 = idx
#define GET_SYMBOL(sym, shdr, symbols, name, idx)
#define GET_INVALID_SYMBOL(sym)

Functions

static int symcache_cmp (const void *a, const void *b)
map< string, SymElf * > * Dyninst::getSymelfCache ()

Define Documentation

#define FOR_EACH_SYMBOL ( shdr,
symbols,
str_buffer,
idx   ) 
Value:
Elf_X_Data sym_data = shdr.get_data(); \
   Elf_X_Sym symbols = sym_data.get_sym(); \
   int str_index = shdr.sh_link(); \
   Elf_X_Shdr str_shdr = elf->get_shdr(str_index); \
   if (!str_shdr.isValid()) { \
      continue; \
   } \
   Elf_X_Data str_data = str_shdr.get_data(); \
   const char *str_buffer = (const char *) str_data.d_buf(); \
   unsigned sym_count = symbols.count(); \
   for (unsigned idx=0; idx<sym_count; idx++)

Definition at line 136 of file SymLite-elf.C.

Referenced by Dyninst::SymElf::createSymCache(), Dyninst::SymElf::getContainingSymbol(), and Dyninst::SymElf::getSymbolByName().

#define GET_INVALID_SYMBOL ( sym   ) 
Value:
sym.v1 = sym.v2 = NULL; \
   sym.i1 = 0; sym.i2 = INVALID_SYM_CODE;

Definition at line 166 of file SymLite-elf.C.

Referenced by Dyninst::SymElf::getContainingSymbol(), and Dyninst::SymElf::getSymbolByName().

#define GET_SYMBOL ( sym,
shdr,
symbols,
name,
idx   ) 
Value:
assert(sym.i2 != INVALID_SYM_CODE); \
   const char *name = (const char *) sym.v1; \
   Elf_X_Shdr shdr = Elf_X_Shdr(elf->wordSize() == 8, (Elf_Scn *) sym.v2); \
   unsigned idx = (unsigned) sym.i1; \
   Elf_X_Data sym_data = shdr.get_data(); \
   Elf_X_Sym symbols = sym_data.get_sym();

Definition at line 158 of file SymLite-elf.C.

Referenced by Dyninst::SymElf::getSymbolName(), Dyninst::SymElf::getSymbolOffset(), Dyninst::SymElf::getSymbolSize(), and Dyninst::SymElf::getSymbolTOC().

#define INVALID_SYM_CODE   ((int) 0xffffffff)
#define MAKE_SYMBOL ( name,
idx,
shdr,
sym   ) 
Value:
sym.v1 = (void *) (const_cast<char *>(name)); \
   sym.v2 = (void *) shdr.getScn(); \
   sym.i1 = (int) idx; \
   sym.i2 = UNSET_INDEX_CODE;

Definition at line 149 of file SymLite-elf.C.

Referenced by Dyninst::SymElf::getContainingSymbol(), Dyninst::SymElf::getSymbolByName(), and Dyninst::SymElf::lookupCachedSymbol().

#define SET_SYM_CACHEINDEX ( sym,
idx   )     sym.i2 = idx

Definition at line 155 of file SymLite-elf.C.

Referenced by Dyninst::SymElf::lookupCachedSymbol().

#define UNSET_INDEX_CODE   ((int) 0xfffffffe)

Function Documentation

static int symcache_cmp ( const void *  a,
const void *  b 
) [static]

Definition at line 363 of file SymLite-elf.C.

References Dyninst::SymCacheEntry::symaddress.

Referenced by Dyninst::SymElf::createSymCache().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1