/third_party/elfutils/libdwfl/ |
H A D | segment.c | 37 __libdwfl_segment_start (Dwfl *dwfl, GElf_Addr start) in __libdwfl_segment_start() argument 39 if (dwfl->segment_align > 1) in __libdwfl_segment_start() 40 start &= -dwfl->segment_align; in __libdwfl_segment_start() 46 __libdwfl_segment_end (Dwfl *dwfl, GElf_Addr end) in __libdwfl_segment_end() argument 48 if (dwfl->segment_align > 1) in __libdwfl_segment_end() 49 end = (end + dwfl->segment_align - 1) & -dwfl->segment_align; in __libdwfl_segment_end() 54 insert (Dwfl *dwfl, size_t i, GElf_Addr start, GElf_Addr end, int segndx) in insert() argument 56 bool need_start = (i == 0 || dwfl->lookup_addr[i - 1] != start); in insert() 57 bool need_end = (i + 1 >= dwfl in insert() 131 lookup(Dwfl *dwfl, GElf_Addr address, int hint) lookup() argument 158 reify_segments(Dwfl *dwfl) reify_segments() argument 245 dwfl_addrsegment(Dwfl *dwfl, Dwarf_Addr address, Dwfl_Module **mod) dwfl_addrsegment() argument [all...] |
H A D | argp-std.c | 95 Dwfl *dwfl; member 103 failure (Dwfl *dwfl, int errnum, const char *msg, struct argp_state *state) in failure() argument 105 if (dwfl != NULL) in failure() 106 dwfl_end (dwfl); in failure() 115 fail (Dwfl *dwfl, int errnum, const char *msg, struct argp_state *state) in fail() argument 117 failure (dwfl, errnum, msg, state); in fail() 143 Dwfl *dwfl = opt->dwfl; in parse_opt() local 144 if (dwfl == NULL) in parse_opt() 146 dwfl in parse_opt() 171 Dwfl *dwfl = INTUSE(dwfl_begin) (&proc_callbacks); parse_opt() local 199 Dwfl *dwfl = INTUSE(dwfl_begin) (&proc_callbacks); parse_opt() local 214 Dwfl *dwfl = opt->dwfl; parse_opt() local 229 Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks); parse_opt() local 249 Dwfl *dwfl = INTUSE(dwfl_begin) (&offline_callbacks); parse_opt() local 264 Dwfl *dwfl = opt->dwfl; parse_opt() local [all...] |
H A D | dwfl_end.c | 36 dwfl_end (Dwfl *dwfl) in dwfl_end() argument 38 if (dwfl == NULL) in dwfl_end() 42 __libdwfl_debuginfod_end (dwfl->debuginfod); in dwfl_end() 45 if (dwfl->process) in dwfl_end() 46 __libdwfl_process_free (dwfl->process); in dwfl_end() 48 free (dwfl->lookup_addr); in dwfl_end() 49 free (dwfl->lookup_module); in dwfl_end() 50 free (dwfl->lookup_segndx); in dwfl_end() 52 Dwfl_Module *next = dwfl->modulelist; in dwfl_end() 60 if (dwfl in dwfl_end() [all...] |
H A D | libdwfl.h | 113 extern void dwfl_report_begin (Dwfl *dwfl); 129 extern int dwfl_report_segment (Dwfl *dwfl, int ndx, 136 extern Dwfl_Module *dwfl_report_module (Dwfl *dwfl, const char *name, 151 extern Dwfl_Module *dwfl_report_elf (Dwfl *dwfl, const char *name, 159 extern Dwfl_Module *dwfl_report_offline (Dwfl *dwfl, const char *name, 163 extern Dwfl_Module *dwfl_report_offline_memory (Dwfl *dwfl, const char *name, 174 extern int dwfl_report_end (Dwfl *dwfl, 185 extern void dwfl_report_begin_add (Dwfl *dwfl); 207 extern ptrdiff_t dwfl_getmodules (Dwfl *dwfl, 215 extern Dwfl_Module *dwfl_addrmodule (Dwfl *dwfl, Dwarf_Add [all...] |
H A D | dwfl_frame.c | 111 Dwfl *dwfl = process->dwfl; in __libdwfl_process_free() local 113 process->callbacks->detach (dwfl, process->callbacks_arg); in __libdwfl_process_free() 114 assert (dwfl->process == process); in __libdwfl_process_free() 115 dwfl->process = NULL; in __libdwfl_process_free() 119 dwfl->attacherr = DWFL_E_NOERROR; in __libdwfl_process_free() 124 process_alloc (Dwfl *dwfl) in process_alloc() argument 129 process->dwfl = dwfl; in process_alloc() 130 dwfl in process_alloc() 134 dwfl_attach_state(Dwfl *dwfl, Elf *elf, pid_t pid, const Dwfl_Thread_Callbacks *thread_callbacks, void *arg) dwfl_attach_state() argument 319 getthread(Dwfl *dwfl, pid_t tid, int (*callback) (Dwfl_Thread *thread, void *arg), void *arg) getthread() argument 384 dwfl_getthread_frames(Dwfl *dwfl, pid_t tid, int (*callback) (Dwfl_Frame *frame, void *arg), void *arg) dwfl_getthread_frames() argument [all...] |
H A D | offline.c | 101 static Dwfl_Module *process_elf (Dwfl *dwfl, const char *name, 103 static Dwfl_Module *process_archive (Dwfl *dwfl, const char *name, 111 process_file (Dwfl *dwfl, const char *name, const char *file_name, int fd, in process_file() argument 123 return process_elf (dwfl, name, file_name, fd, elf); in process_file() 126 return process_archive (dwfl, name, file_name, fd, elf, predicate); in process_file() 132 process_elf (Dwfl *dwfl, const char *name, const char *file_name, int fd, in process_elf() argument 135 Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name, fd, elf, in process_elf() 136 dwfl->offline_next_address, true, in process_elf() 146 if ((dwfl->offline_next_address >= mod->low_addr in process_elf() 147 || mod->low_addr - dwfl in process_elf() 168 process_archive_member(Dwfl *dwfl, const char *name, const char *file_name, int (*predicate) (const char *module, const char *file), int fd, Elf *member, Dwfl_Module **mod) process_archive_member() argument 249 process_archive(Dwfl *dwfl, const char *name, const char *file_name, int fd, Elf *archive, int (*predicate) (const char *module, const char *file)) process_archive() argument 280 __libdwfl_report_offline(Dwfl *dwfl, const char *name, const char *file_name, int fd, bool closefd, int (*predicate) (const char *module, const char *file)) __libdwfl_report_offline() argument 303 dwfl_report_offline(Dwfl *dwfl, const char *name, const char *file_name, int fd) dwfl_report_offline() argument [all...] |
H A D | link_map.c | 136 integrated_memory_callback (Dwfl *dwfl, int ndx, in integrated_memory_callback() 154 return (*info->memory_callback) (dwfl, ndx, buffer, buffer_available, in integrated_memory_callback() 165 return (*info->memory_callback) (dwfl, ndx, buffer, buffer_available, in integrated_memory_callback() 169 if ((*info->memory_callback) (dwfl, ndx, &info->buffer, buffer_available, in integrated_memory_callback() 179 (void) INTUSE(dwfl_addrsegment) (dwfl, vaddr, &mod); in integrated_memory_callback() 192 (dwfl, 0, buffer, buffer_available, in integrated_memory_callback() 231 Dwfl *dwfl; 241 (*closure->callback) (closure->dwfl, -1, buffer, buffer_available, 0, 0, in release_buffer() 255 Dwfl *dwfl = closure->dwfl; in read_addrs() 135 integrated_memory_callback(Dwfl *dwfl, int ndx, void **buffer, size_t *buffer_available, GElf_Addr vaddr, size_t minread, void *arg) integrated_memory_callback() argument 229 Dwfl *dwfl; global() member 253 Dwfl *dwfl = closure->dwfl; read_addrs() local 309 report_r_debug(uint_fast8_t elfclass, uint_fast8_t elfdata, Dwfl *dwfl, GElf_Addr r_debug_vaddr, Dwfl_Memory_Callback *memory_callback, void *memory_callback_arg, struct r_debug_info *r_debug_info) report_r_debug() argument 696 find_executable(Dwfl *dwfl, GElf_Addr at_phdr, GElf_Addr at_entry, uint_fast8_t *elfclass, uint_fast8_t *elfdata, Dwfl_Memory_Callback *memory_callback, void *memory_callback_arg) find_executable() argument 717 dwfl_link_map_report(Dwfl *dwfl, const void *auxv, size_t auxv_size, Dwfl_Memory_Callback *memory_callback, void *memory_callback_arg, struct r_debug_info *r_debug_info) dwfl_link_map_report() argument [all...] |
H A D | dwfl_getmodules.c | 36 dwfl_getmodules (Dwfl *dwfl, in dwfl_getmodules() argument 42 if (dwfl == NULL) in dwfl_getmodules() 53 Dwfl_Module *m = dwfl->modulelist; in dwfl_getmodules() 64 else if (((offset & 3) == 2) && likely (dwfl->lookup_module != NULL)) in dwfl_getmodules() 68 if ((size_t) offset - 1 == dwfl->lookup_elts) in dwfl_getmodules() 71 if (unlikely ((size_t) offset - 1 > dwfl->lookup_elts)) in dwfl_getmodules() 74 m = dwfl->lookup_module[offset - 1]; in dwfl_getmodules() 90 return ((dwfl->lookup_module == NULL) ? ((offset << 2) | 1) in dwfl_getmodules() 91 : (((m == NULL ? (ptrdiff_t) dwfl->lookup_elts + 1 in dwfl_getmodules()
|
H A D | core-file.c | 126 dwfl_report_core_segments (Dwfl *dwfl, Elf *elf, size_t phnum, GElf_Phdr *notes) in dwfl_report_core_segments() argument 128 if (unlikely (dwfl == NULL)) in dwfl_report_core_segments() 148 result = dwfl_report_segment (dwfl, ndx, phdr, 0, NULL); in dwfl_report_core_segments() 283 dwfl_elf_phdr_memory_callback (Dwfl *dwfl, int ndx, in dwfl_elf_phdr_memory_callback() argument 301 const GElf_Off align = dwfl->segment_align ?: 1; in dwfl_elf_phdr_memory_callback() 449 dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const char *executable) in dwfl_core_file_report() argument 459 if (dwfl->user_core != NULL) in dwfl_core_file_report() 460 free (dwfl->user_core->executable_for_core); in dwfl_core_file_report() 463 if (dwfl->user_core != NULL) in dwfl_core_file_report() 464 dwfl in dwfl_core_file_report() [all...] |
H A D | dwfl_module.c | 127 dwfl_report_begin_add (Dwfl *dwfl __attribute__ ((unused))) in dwfl_report_begin_add() 135 dwfl_report_begin (Dwfl *dwfl) in INTDEF() 138 dwfl->lookup_elts = 0; in INTDEF() 140 for (Dwfl_Module *m = dwfl->modulelist; m != NULL; m = m->next) in INTDEF() 143 dwfl->offline_next_address = OFFLINE_REDZONE; in INTDEF() 148 use (Dwfl_Module *mod, Dwfl_Module **tailp, Dwfl *dwfl) in use() argument 153 if (unlikely (dwfl->lookup_module != NULL)) in use() 155 free (dwfl->lookup_module); in use() 156 dwfl->lookup_module = NULL; in use() 166 dwfl_report_module (Dwfl *dwfl, cons argument [all...] |
H A D | linux-proc-maps.c | 96 grovel_auxv (pid_t pid, Dwfl *dwfl, GElf_Addr *sysinfo_ehdr) in grovel_auxv() argument 109 GElf_Addr segment_align64 = dwfl->segment_align; in grovel_auxv() 110 GElf_Addr segment_align32 = dwfl->segment_align; in grovel_auxv() 160 bool valid64 = sysinfo_ehdr64 != 0 || segment_align64 != dwfl->segment_align; in grovel_auxv() 161 bool valid32 = sysinfo_ehdr32 != 0 || segment_align32 != dwfl->segment_align; in grovel_auxv() 170 dwfl->segment_align = segment_align64; in grovel_auxv() 176 dwfl->segment_align = segment_align32; in grovel_auxv() 183 do_report (Dwfl *dwfl, char **plast_file, Dwarf_Addr low, Dwarf_Addr high) in do_report() argument 187 Dwfl_Module *mod = INTUSE(dwfl_report_module) (dwfl, *plast_file, in do_report() 197 #define report() do_report(dwfl, 200 proc_maps_report(Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid) proc_maps_report() argument 287 dwfl_linux_proc_maps_report(Dwfl *dwfl, FILE *f) dwfl_linux_proc_maps_report() argument [all...] |
H A D | debuginfod-client.c | 53 dwfl_get_debuginfod_client (Dwfl *dwfl) in dwfl_get_debuginfod_client() argument 55 if (dwfl->debuginfod != NULL) in dwfl_get_debuginfod_client() 56 return dwfl->debuginfod; in dwfl_get_debuginfod_client() 62 dwfl->debuginfod = (*fp_debuginfod_begin) (); in dwfl_get_debuginfod_client() 63 return dwfl->debuginfod; in dwfl_get_debuginfod_client() 71 __libdwfl_debuginfod_find_executable (Dwfl *dwfl, in INTDEF() 78 debuginfod_client *c = INTUSE (dwfl_get_debuginfod_client) (dwfl); in INTDEF() 88 __libdwfl_debuginfod_find_debuginfo (Dwfl *dwfl, in __libdwfl_debuginfod_find_debuginfo() argument 95 debuginfod_client *c = INTUSE (dwfl_get_debuginfod_client) (dwfl); in __libdwfl_debuginfod_find_debuginfo()
|
H A D | dwfl_begin.c | 44 Dwfl *dwfl = calloc (1, sizeof *dwfl); in dwfl_begin() local 45 if (dwfl == NULL) in dwfl_begin() 49 dwfl->callbacks = callbacks; in dwfl_begin() 50 dwfl->offline_next_address = OFFLINE_REDZONE; in dwfl_begin() 53 return dwfl; in dwfl_begin()
|
/third_party/elfutils/include/elfutils/ |
H A D | libdwfl.h | 113 extern void dwfl_report_begin (Dwfl *dwfl); 129 extern int dwfl_report_segment (Dwfl *dwfl, int ndx, 136 extern Dwfl_Module *dwfl_report_module (Dwfl *dwfl, const char *name, 151 extern Dwfl_Module *dwfl_report_elf (Dwfl *dwfl, const char *name, 159 extern Dwfl_Module *dwfl_report_offline (Dwfl *dwfl, const char *name, 163 extern Dwfl_Module *dwfl_report_offline_memory (Dwfl *dwfl, const char *name, 174 extern int dwfl_report_end (Dwfl *dwfl, 185 extern void dwfl_report_begin_add (Dwfl *dwfl); 207 extern ptrdiff_t dwfl_getmodules (Dwfl *dwfl, 215 extern Dwfl_Module *dwfl_addrmodule (Dwfl *dwfl, Dwarf_Add [all...] |
/third_party/elfutils/tests/ |
H A D | dwfl-bug-addr-overflow.c | 24 #include ELFUTILS_HEADER(dwfl) 43 Dwfl *dwfl = dwfl_begin (&offline_callbacks); in main() local 44 assert (dwfl != NULL); in main() 46 Dwfl_Module *high = dwfl_report_module (dwfl, "high", in main() 50 Dwfl_Module *low = dwfl_report_module (dwfl, "low", in main() 54 Dwfl_Module *middle = dwfl_report_module (dwfl, "middle", in main() 59 int ret = dwfl_report_end (dwfl, NULL, NULL); in main() 62 Dwfl_Module *mod = dwfl_addrmodule (dwfl, UINT64_C (0xffffffff00010123)); in main() 64 mod = dwfl_addrmodule (dwfl, UINT64_C (0x00010123)); in main() 66 mod = dwfl_addrmodule (dwfl, UINT64_ in main() [all...] |
H A D | dwfl-bug-getmodules.c | 19 #include ELFUTILS_HEADER(dwfl) 47 Dwfl *dwfl = dwfl_begin (&callbacks); in main() local 49 dwfl_report_module (dwfl, "m1", 0, 0x1000); in main() 50 dwfl_report_module (dwfl, "m2", 0x2000, 0x3000); in main() 51 dwfl_report_module (dwfl, "m3", 0x4000, 0x5000); in main() 53 dwfl_report_end (dwfl, NULL, NULL); in main() 55 ptrdiff_t offset = dwfl_getmodules (dwfl, &iterate, dwfl, 0); in main() 59 offset = dwfl_getmodules (dwfl, &iterate, NULL, offset); in main() 63 dwfl_end (dwfl); in main() [all...] |
H A D | dwfl-bug-fd-leak.c | 40 #include ELFUTILS_HEADER(dwfl) 54 Dwfl *dwfl = dwfl_begin (&proc_callbacks); in elfutils_open() local 55 if (dwfl == NULL) in elfutils_open() 58 int result = dwfl_linux_proc_report (dwfl, pid); in elfutils_open() 64 if (dwfl_report_end (dwfl, NULL, NULL) != 0) in elfutils_open() 68 Dwarf *dbg = dwfl_addrdwarf (dwfl, address, &bias); in elfutils_open() 77 Dwfl_Module *module = dwfl_addrmodule (dwfl, address); in elfutils_open() 86 return dwfl; in elfutils_open() 90 elfutils_close (Dwfl *dwfl) in elfutils_close() argument 92 dwfl_end (dwfl); in elfutils_close() 117 Dwfl *dwfl = elfutils_open (getpid (), (Dwarf_Addr) (uintptr_t) &main); main() local [all...] |
H A D | backtrace-dwarf.c | 25 #include ELFUTILS_HEADER(dwfl) 48 report_pid (Dwfl *dwfl, pid_t pid) in report_pid() argument 50 int result = dwfl_linux_proc_report (dwfl, pid); in report_pid() 56 if (dwfl_report_end (dwfl, NULL, NULL) != 0) in report_pid() 59 result = dwfl_linux_proc_attach (dwfl, pid, true); in report_pid() 77 Dwfl *dwfl = dwfl_begin (&proc_callbacks); in pid_to_dwfl() local 78 if (dwfl == NULL) in pid_to_dwfl() 80 report_pid (dwfl, pid); in pid_to_dwfl() 81 return dwfl; in pid_to_dwfl() 98 Dwfl *dwfl in frame_callback() local 171 Dwfl *dwfl = pid_to_dwfl (pid); main() local [all...] |
H A D | dwfl-report-segment-contiguous.c | 24 #include ELFUTILS_HEADER(dwfl) 43 Dwfl *dwfl = dwfl_begin (&offline_callbacks); in main() local 44 assert (dwfl != NULL); in main() 57 int ndx = dwfl_report_segment (dwfl, 1, &phdr1, 0, dwfl); in main() 60 ndx = dwfl_addrsegment (dwfl, 0xf00, NULL); in main() 73 ndx = dwfl_report_segment (dwfl, 2, &phdr2, 0, dwfl); in main() 76 ndx = dwfl_addrsegment (dwfl, 0x1000, NULL); in main() 79 dwfl_end (dwfl); in main() [all...] |
H A D | backtrace.c | 39 #include ELFUTILS_HEADER(dwfl) 72 const char *symname, Dwfl *dwfl) in callback_verify() 147 mod = dwfl_addrmodule (dwfl, pc - 1); in callback_verify() 184 mod = dwfl_addrmodule (dwfl, pc); in callback_verify() 228 Dwfl *dwfl = dwfl_thread_dwfl (thread); in frame_callback() local 229 Dwfl_Module *mod = dwfl_addrmodule (dwfl, pc_adjusted); in frame_callback() 237 callback_verify (tid, *framenop, pc, symname, dwfl); in frame_callback() 265 dump (Dwfl *dwfl) in dump() argument 267 ptrdiff_t ptrdiff = dwfl_getmodules (dwfl, dump_modules, NULL, 0); in dump() 270 switch (dwfl_getthreads (dwfl, thread_callbac in dump() 71 callback_verify(pid_t tid, unsigned frameno, Dwarf_Addr pc, const char *symname, Dwfl *dwfl) callback_verify() argument 348 report_pid(Dwfl *dwfl, pid_t pid) report_pid() argument 377 Dwfl *dwfl = dwfl_begin (&proc_callbacks); pid_to_dwfl() local 419 Dwfl *dwfl = pid_to_dwfl (pid); exec_dump() local 520 Dwfl *dwfl = NULL; main() local [all...] |
H A D | dwfl-addr-sect.c | 28 #include ELFUTILS_HEADER(dwfl) 33 handle_address (Dwfl *dwfl, Dwarf_Addr address) in handle_address() argument 35 Dwfl_Module *mod = dwfl_addrmodule (dwfl, address); in handle_address() 62 Dwfl *dwfl = NULL; in main() local 63 (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining, &dwfl); in main() local 64 assert (dwfl != NULL); in main() 72 result |= handle_address (dwfl, addr); in main() 77 dwfl_end (dwfl); in main()
|
H A D | backtrace-data.c | 41 #include ELFUTILS_HEADER(dwfl) 72 memory_read (Dwfl *dwfl, Dwarf_Addr addr, Dwarf_Word *result, in memory_read() argument 75 pid_t child = dwfl_pid (dwfl); in memory_read() 148 report_module (Dwfl *dwfl, pid_t child, Dwarf_Addr addr) in report_module() argument 154 Dwfl_Module *mod = dwfl_report_elf (dwfl, long_name, long_name, -1, in report_module() 158 assert (dwfl_addrmodule (dwfl, addr) == mod); in report_module() 163 next_thread (Dwfl *dwfl, void *dwfl_arg __attribute__ ((unused)), in next_thread() argument 171 return dwfl_pid (dwfl); in next_thread() 236 Dwfl *dwfl = dwfl_thread_dwfl (dwfl_frame_thread (state)); in frame_callback() local 237 Dwfl_Module *mod = dwfl_addrmodule (dwfl, pc_adjuste in frame_callback() 307 Dwfl *dwfl = dwfl_begin (&offline_callbacks); main() local [all...] |
H A D | addrscopes.c | 21 #include ELFUTILS_HEADER(dwfl) 95 handle_address (GElf_Addr pc, Dwfl *dwfl) in handle_address() argument 98 Dwarf_Die *cudie = dwfl_addrdie (dwfl, pc, &cubias); in handle_address() 127 Dwfl_Line *loline = dwfl_getsrc (dwfl, lowpc); in handle_address() 128 Dwfl_Line *hiline = dwfl_getsrc (dwfl, highpc - 1); in handle_address() 149 Dwfl *dwfl = NULL; in main() local 150 (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining, &dwfl); in main() local 151 assert (dwfl != NULL); in main() 172 handle_address (addr, dwfl); in main() 186 handle_address (addr, dwfl); in main() [all...] |
H A D | dwfl-bug-report.c | 19 #include ELFUTILS_HEADER(dwfl) 36 Dwfl *dwfl = dwfl_begin (&callbacks); in main() local 40 dwfl_report_begin (dwfl); in main() 41 dwfl_report_module (dwfl, "module1", 0, 10); in main() 42 dwfl_report_end (dwfl, NULL, NULL); in main() 45 dwfl_end (dwfl); in main()
|
H A D | addrcfi.c | 21 #include ELFUTILS_HEADER(dwfl) 105 handle_cfi (Dwfl *dwfl, const char *which, Dwarf_CFI *cfi, in handle_cfi() argument 151 (void) dwfl_module_register_names (dwfl_addrmodule (dwfl, pc), in handle_cfi() 158 handle_address (GElf_Addr pc, Dwfl *dwfl) in handle_address() argument 160 Dwfl_Module *mod = dwfl_addrmodule (dwfl, pc); in handle_address() 165 int res = handle_cfi (dwfl, ".eh_frame", in handle_address() 171 res &= handle_cfi (dwfl, ".debug_frame", in handle_address() 186 Dwfl *dwfl = NULL; in main() local 187 (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining, &dwfl); in main() local 188 assert (dwfl ! in main() [all...] |