19 #ifndef ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_ 20 #define ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_ 28 #ifdef ABSL_HAVE_ELF_MEM_IMAGE 29 #error ABSL_HAVE_ELF_MEM_IMAGE cannot be directly set 32 #if defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \ 33 !defined(__asmjs__) && !defined(__wasm__) 34 #define ABSL_HAVE_ELF_MEM_IMAGE 1 37 #if ABSL_HAVE_ELF_MEM_IMAGE 42 namespace debugging_internal {
48 static const int kInvalidBaseSentinel;
52 static constexpr
const void *
const kInvalidBase =
53 static_cast<const void*
>(&kInvalidBaseSentinel);
63 const ElfW(Sym) *symbol;
67 class SymbolIterator {
69 friend class ElfMemImage;
70 const SymbolInfo *operator->()
const;
72 SymbolIterator& operator++();
73 bool operator!=(
const SymbolIterator &rhs)
const;
74 bool operator==(
const SymbolIterator &rhs)
const;
76 SymbolIterator(
const void *
const image,
int index);
77 void Update(
int incr);
80 const void *
const image_;
84 explicit ElfMemImage(
const void *base);
85 void Init(
const void *base);
86 bool IsPresent()
const {
return ehdr_ !=
nullptr; }
87 const ElfW(Phdr)* GetPhdr(
int index)
const;
88 const ElfW(Sym)* GetDynsym(
int index)
const;
89 const ElfW(Versym)* GetVersym(
int index)
const;
90 const ElfW(Verdef)* GetVerdef(
int index)
const;
91 const ElfW(Verdaux)* GetVerdefAux(
const ElfW(Verdef) *verdef)
const;
92 const char* GetDynstr(ElfW(Word) offset)
const;
93 const void* GetSymAddr(
const ElfW(Sym) *sym)
const;
94 const char* GetVerstr(ElfW(Word) offset)
const;
95 int GetNumSymbols()
const;
97 SymbolIterator
begin()
const;
98 SymbolIterator
end()
const;
104 bool LookupSymbol(
const char *
name,
const char *
version,
105 int symbol_type, SymbolInfo *info_out)
const;
111 bool LookupSymbolByAddress(
const void *address, SymbolInfo *info_out)
const;
114 const ElfW(Ehdr) *ehdr_;
115 const ElfW(Sym) *dynsym_;
116 const ElfW(Versym) *versym_;
117 const ElfW(Verdef) *verdef_;
118 const ElfW(Word) *hash_;
122 ElfW(Addr) link_base_;
128 #endif // ABSL_HAVE_ELF_MEM_IMAGE 130 #endif // ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_
uint128 operator*(uint128 lhs, uint128 rhs)
bool operator==(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)
bool operator!=(const absl::InlinedVector< T, N, A > &a, const absl::InlinedVector< T, N, A > &b)