Warning, file /include/absl/debugging/internal/symbolize.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_
0019 #define ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_
0020
0021 #ifdef __cplusplus
0022
0023 #include <cstddef>
0024 #include <cstdint>
0025
0026 #include "absl/base/config.h"
0027 #include "absl/strings/string_view.h"
0028
0029 #ifdef ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE
0030 #error ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE cannot be directly set
0031 #elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) \
0032 && !defined(__asmjs__) && !defined(__wasm__)
0033 #define ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE 1
0034
0035 #include <elf.h>
0036 #include <link.h> // For ElfW() macro.
0037 #include <functional>
0038 #include <string>
0039
0040 namespace absl {
0041 ABSL_NAMESPACE_BEGIN
0042 namespace debugging_internal {
0043
0044
0045
0046
0047
0048
0049
0050 bool ForEachSection(int fd,
0051 const std::function<bool(absl::string_view name,
0052 const ElfW(Shdr) &)>& callback);
0053
0054
0055
0056 bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
0057 ElfW(Shdr) *out);
0058
0059 }
0060 ABSL_NAMESPACE_END
0061 }
0062
0063 #endif
0064
0065 #ifdef ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE
0066 #error ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE cannot be directly set
0067 #elif defined(__APPLE__)
0068 #define ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE 1
0069 #endif
0070
0071 #ifdef ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE
0072 #error ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE cannot be directly set
0073 #elif defined(__EMSCRIPTEN__)
0074 #define ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE 1
0075 #endif
0076
0077 namespace absl {
0078 ABSL_NAMESPACE_BEGIN
0079 namespace debugging_internal {
0080
0081 struct SymbolDecoratorArgs {
0082
0083 const void *pc;
0084
0085 ptrdiff_t relocation;
0086
0087
0088 int fd;
0089
0090
0091
0092
0093
0094 char *const symbol_buf;
0095 size_t symbol_buf_size;
0096
0097
0098
0099 char *const tmp_buf;
0100 size_t tmp_buf_size;
0101
0102 void* arg;
0103 };
0104 using SymbolDecorator = void (*)(const SymbolDecoratorArgs *);
0105
0106
0107
0108
0109
0110 int InstallSymbolDecorator(SymbolDecorator decorator, void* arg);
0111
0112
0113
0114 bool RemoveSymbolDecorator(int ticket);
0115
0116
0117
0118 bool RemoveAllSymbolDecorators();
0119
0120
0121
0122
0123
0124
0125
0126
0127 bool RegisterFileMappingHint(const void* start, const void* end,
0128 uint64_t offset, const char* filename);
0129
0130
0131
0132
0133
0134 bool GetFileMappingHint(const void** start, const void** end, uint64_t* offset,
0135 const char** filename);
0136
0137 }
0138 ABSL_NAMESPACE_END
0139 }
0140
0141 #endif
0142
0143 #include <stdbool.h>
0144
0145 #ifdef __cplusplus
0146 extern "C"
0147 #endif
0148
0149 bool
0150 AbslInternalGetFileMappingHint(const void** start, const void** end,
0151 uint64_t* offset, const char** filename);
0152
0153 #endif