39 #ifndef ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_
40 #define ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_
44 #include "absl/base/attributes.h"
45 #include "absl/debugging/internal/elf_mem_image.h"
47 #ifdef ABSL_HAVE_ELF_MEM_IMAGE
49 #ifdef ABSL_HAVE_VDSO_SUPPORT
50 #error ABSL_HAVE_VDSO_SUPPORT cannot be directly set
52 #define ABSL_HAVE_VDSO_SUPPORT 1
57 namespace debugging_internal {
65 typedef ElfMemImage::SymbolInfo SymbolInfo;
66 typedef ElfMemImage::SymbolIterator SymbolIterator;
79 bool IsPresent()
const {
return image_.IsPresent(); }
82 SymbolIterator
begin()
const {
return image_.begin(); }
83 SymbolIterator
end()
const {
return image_.end(); }
89 bool LookupSymbol(
const char *
name,
const char *
version,
90 int symbol_type, SymbolInfo *info_out)
const;
96 bool LookupSymbolByAddress(
const void *address, SymbolInfo *info_out)
const;
102 const void *SetBase(
const void *s);
106 static const void *
Init();
122 static std::atomic<const void *> vdso_base_;
128 static long InitAndGetCPU(
unsigned *cpu,
void *cache,
130 static long GetCPUViaSyscall(
unsigned *cpu,
void *cache,
132 typedef long (*GetCpuFn)(
unsigned *cpu,
void *cache,
139 friend int GetCPU(
void);
141 VDSOSupport(
const VDSOSupport&) =
delete;
142 VDSOSupport& operator=(
const VDSOSupport&) =
delete;
156 #endif // ABSL_HAVE_ELF_MEM_IMAGE
158 #endif // ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_