39 #ifndef ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_ 40 #define ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_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 56 namespace debugging_internal {
64 typedef ElfMemImage::SymbolInfo SymbolInfo;
65 typedef ElfMemImage::SymbolIterator SymbolIterator;
72 enum { kVDSOSymbolType = STT_NOTYPE };
74 enum { kVDSOSymbolType = STT_FUNC };
78 bool IsPresent()
const {
return image_.IsPresent(); }
81 SymbolIterator
begin()
const {
return image_.begin(); }
82 SymbolIterator
end()
const {
return image_.end(); }
88 bool LookupSymbol(
const char *
name,
const char *
version,
89 int symbol_type, SymbolInfo *info_out)
const;
95 bool LookupSymbolByAddress(
const void *address, SymbolInfo *info_out)
const;
101 const void *SetBase(
const void *s);
105 static const void *Init();
121 static std::atomic<const void *> vdso_base_;
127 static long InitAndGetCPU(
unsigned *cpu,
void *cache,
129 static long GetCPUViaSyscall(
unsigned *cpu,
void *cache,
131 typedef long (*GetCpuFn)(
unsigned *cpu,
void *cache,
138 friend int GetCPU(
void);
140 VDSOSupport(
const VDSOSupport&) =
delete;
141 VDSOSupport& operator=(
const VDSOSupport&) =
delete;
154 #endif // ABSL_HAVE_ELF_MEM_IMAGE 156 #endif // ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_