diff options
author | Ian Lance Taylor <iant@google.com> | 2012-10-09 18:20:45 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-09 18:20:45 +0000 |
commit | e561a9920cce1e638826a53599eb55ec44ce54c2 (patch) | |
tree | cf3815f8c8b0babee15a42892364a912abc14de3 /libbacktrace/internal.h | |
parent | 1a61077e0ef68c9c4453f86c408a302518dd8075 (diff) | |
download | gcc-e561a9920cce1e638826a53599eb55ec44ce54c2.zip gcc-e561a9920cce1e638826a53599eb55ec44ce54c2.tar.gz gcc-e561a9920cce1e638826a53599eb55ec44ce54c2.tar.bz2 |
Add support for tracing through shared libraries.
* configure.ac: Check for link.h and dl_iterate_phdr.
* elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
ELF macros before #defining them.
(dl_phdr_info, dl_iterate_phdr): Define if system does not have
dl_iterate_phdr.
(struct elf_syminfo_data): Add next field.
(elf_initialize_syminfo): Initialize next field.
(elf_add_syminfo_data): New static function.
(elf_add): New static function, broken out of
backtrace_initialize. Call backtrace_dwarf_add instead of
backtrace_dwarf_initialize.
(struct phdr_data): Define.
(phdr_callback): New static function.
(backtrace_initialize): Call elf_add.
* dwarf.c (struct dwarf_data): Add next and base_address fields.
(add_unit_addr): Add base_address parameter. Change all callers.
(add_unit_ranges, build_address_map): Likewise.
(add_line): Add ddata parameter. Change all callers.
(read_line_program, add_function_range): Likewise.
(dwarf_lookup_pc): New static function, broken out of
dwarf_fileline.
(dwarf_fileline): Call dwarf_lookup_pc.
(build_dwarf_data): New static function.
(backtrace_dwarf_add): New function.
(backtrace_dwarf_initialize): Remove.
* internal.h (backtrace_dwarf_initialize): Don't declare.
(backtrace_dwarf_add): Declare.
* configure, config.h.in: Rebuild.
From-SVN: r192267
Diffstat (limited to 'libbacktrace/internal.h')
-rw-r--r-- | libbacktrace/internal.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h index 4a7407a..b1afca0 100644 --- a/libbacktrace/internal.h +++ b/libbacktrace/internal.h @@ -215,21 +215,22 @@ extern int backtrace_initialize (struct backtrace_state *state, void *data, fileline *fileline_fn); -/* Prepare to read file/line information from DWARF debug data. */ - -extern int backtrace_dwarf_initialize (struct backtrace_state *state, - const unsigned char* dwarf_info, - size_t dwarf_info_size, - const unsigned char *dwarf_line, - size_t dwarf_line_size, - const unsigned char *dwarf_abbrev, - size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, - size_t dwarf_range_size, - const unsigned char *dwarf_str, - size_t dwarf_str_size, - int is_bigendian, - backtrace_error_callback error_callback, - void *data, fileline *fileline_fn); +/* Add file/line information for a DWARF module. */ + +extern int backtrace_dwarf_add (struct backtrace_state *state, + uintptr_t base_address, + const unsigned char* dwarf_info, + size_t dwarf_info_size, + const unsigned char *dwarf_line, + size_t dwarf_line_size, + const unsigned char *dwarf_abbrev, + size_t dwarf_abbrev_size, + const unsigned char *dwarf_ranges, + size_t dwarf_range_size, + const unsigned char *dwarf_str, + size_t dwarf_str_size, + int is_bigendian, + backtrace_error_callback error_callback, + void *data, fileline *fileline_fn); #endif |