|
UFO: Alien Invasion
|
#include <unistd.h>#include <sys/stat.h>#include <getopt.h>#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <errno.h>#include <limits.h>#include <assert.h>#include "bfd.h"#include "bucomm.h"#include "demangle.h"#include "libiberty.h"
Go to the source code of this file.
Data Structures | |
| struct | libtrace_data |
| struct | sym_info |
Macros | |
| #define | ADDR_BUF_LEN ((CHAR_BIT/4)*(sizeof(void*))+1) |
Functions | |
| static int | slurp_symtab (bfd *) |
| static void | find_address_in_section (bfd *, asection *, void *) |
| static void | find_offset_in_section (bfd *, asection *, sym_info *) |
| static int | translate_addresses (bfd *abfd, asection *section, void *addr, char *buf_func, size_t buf_func_len, char *buf_file, size_t buf_file_len) |
| void | bfd_nonfatal (const char *string) |
| void | report (const char *format, va_list args) |
| void | non_fatal (const char *format,...) |
| off_t | get_file_size (const char *file_name) |
| void | list_matching_formats (char **p) |
| void | set_default_bfd_target (void) |
| int | libtrace_init (const char *file_name, const char *section_name, const char *target) |
| int | libtrace_close (void) |
| int | libtrace_resolve (void *addr, char *buf_func, size_t buf_func_len, char *buf_file, size_t buf_file_len,...) |
Variables | |
| static libtrace_data | m_libtrace_data |
| static const char * | program_name = "addr2line" |
Definition in file addr2line.cpp.
| #define ADDR_BUF_LEN ((CHAR_BIT/4)*(sizeof(void*))+1) |
Referenced by translate_addresses().
| void bfd_nonfatal | ( | const char * | string | ) |
Definition at line 60 of file addr2line.cpp.
References program_name.
Referenced by libtrace_init(), and slurp_symtab().
Look for an address in a section. This is called via bfd_map_over_sections.
Definition at line 161 of file addr2line.cpp.
References data, sym_info::filename, sym_info::found, sym_info::functionname, sym_info::line, m_libtrace_data, and sym_info::pc.
Referenced by translate_addresses().
Look for an offset in a section. This is directly called.
Definition at line 186 of file addr2line.cpp.
References sym_info::filename, sym_info::found, sym_info::functionname, sym_info::line, m_libtrace_data, and sym_info::pc.
Referenced by translate_addresses().
| off_t get_file_size | ( | const char * | file_name | ) |
Returns the size of the named file. If the file does not exist, or if it is not a real file, then a suitable non-fatal error message is printed and zero is returned.
Definition at line 89 of file addr2line.cpp.
References non_fatal().
Referenced by libtrace_init().
Definition at line 308 of file addr2line.cpp.
References m_libtrace_data.
| int libtrace_init | ( | const char * | file_name, |
| const char * | section_name, | ||
| const char * | target ) |
Definition at line 265 of file addr2line.cpp.
References bfd_nonfatal(), get_file_size(), list_matching_formats(), m_libtrace_data, non_fatal(), set_default_bfd_target(), and slurp_symtab().
| int libtrace_resolve | ( | void * | addr, |
| char * | buf_func, | ||
| size_t | buf_func_len, | ||
| char * | buf_file, | ||
| size_t | buf_file_len, | ||
| ... ) |
Definition at line 318 of file addr2line.cpp.
References m_libtrace_data, and translate_addresses().
| void list_matching_formats | ( | char ** | p | ) |
After a FALSE return from bfd_check_format_matches with bfd_get_error () == bfd_error_file_ambiguously_recognized, print the possible matching targets.
Definition at line 109 of file addr2line.cpp.
References program_name.
Referenced by libtrace_init().
| void non_fatal | ( | const char * | format, |
| ... ) |
Definition at line 77 of file addr2line.cpp.
References format(), and report().
Referenced by get_file_size(), libtrace_init(), and set_default_bfd_target().
| void report | ( | const char * | format, |
| va_list | args ) |
Definition at line 70 of file addr2line.cpp.
References format(), and program_name.
Referenced by non_fatal().
Set the default BFD target based on the configured target. Doing this permits the binutils to be configured for a particular target, and linked against a shared BFD library which was configured for a different target.
Definition at line 124 of file addr2line.cpp.
References non_fatal().
Referenced by libtrace_init().
|
static |
Read in the symbol table.
Definition at line 139 of file addr2line.cpp.
References bfd_nonfatal(), and m_libtrace_data.
Referenced by libtrace_init().
|
static |
Translate xaddr into file_name:line_number and optionally function name.
Definition at line 206 of file addr2line.cpp.
References ADDR_BUF_LEN, sym_info::filename, find_address_in_section(), find_offset_in_section(), sym_info::found, sym_info::functionname, sym_info::line, m_libtrace_data, name, and sym_info::pc.
Referenced by libtrace_resolve().
|
static |
Definition at line 38 of file addr2line.cpp.
Referenced by find_address_in_section(), find_offset_in_section(), libtrace_close(), libtrace_init(), libtrace_resolve(), slurp_symtab(), and translate_addresses().
|
static |
Definition at line 58 of file addr2line.cpp.
Referenced by bfd_nonfatal(), list_matching_formats(), and report().