summaryrefslogtreecommitdiffstats
path: root/src/addr2line.c
Commit message (Collapse)AuthorAgeFilesLines
* addr2line: Add explicit fflush for stdout when reading from stdin.Mark Wielaard2018-05-121-0/+1
| | | | | | | | | To make it possible to use eu-addr2line interactively through a pipe we need to explicitly flush stdout after handling each line from stdin. https://sourceware.org/bugzilla/show_bug.cgi?id=23173 Signed-off-by: Mark Wielaard <[email protected]>
* Use fallthrough attribute.Joshua Watt2018-02-101-1/+1
| | | | | | | | | | | | | | | Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt <[email protected]>
* Move print_version into printversion.{h|c}Ulf Hermann2017-02-171-0/+1
| | | | | | | | Rename version.c so that the implementation is called after the header and the header doesn't clash with the toplevel version.h. print_version depends on argp and is only used in the tools. Signed-off-by: Ulf Hermann <[email protected]>
* http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/Mark Wielaard2016-12-241-15/+0
| | | | | | | | | | | | | | | | | fedorahosted used to be our home, but we are now hosted at sourceware. Change the elfutils project home to http://elfutils.org/ Point hosted services (email, release, git, bug tracker and web pages) to https://sourceware.org/elfutils/ Move design notes from README to NOTES. Add URLs for home, releases, bugs, git and mailinglist to README. Make the --version output of all tools the same by using a common print_version function and update the publicly shown copyright holder to the elfutils developers. Signed-off-by: Mark Wielaard <[email protected]>
* Add GCC7 -Wimplicit-fallthrough support/fixes.Mark Wielaard2016-11-101-0/+1
| | | | | | | | | | | GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one small buglet in elflint option procession. So it seems useful to enable to make sure all swatch case fallthroughs are deliberate. Add configure check to detect whether gcc support -Wimplicit-fallthrough and enable it. Add fixes and explicit fallthrough comments where necessary. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Fix memory leak in print_dwarf_function.Mark Wielaard2015-06-101-5/+10
| | | | | | Always free the scopes returned by dwarf_getscopes () when done. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Set scopes to NULL after free in handle_address.Mark Wielaard2015-05-271-0/+1
| | | | | | | If dwarf_getscopes_die () fails then scopes might not be reset and we could cause a double free. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Add --pretty-print option to show all information on one line.Mark Wielaard2015-05-271-11/+36
| | | | | | | | | | | | | | | | | | This adds an option --pretty-print to eu-addr2line to show all information on one line and all inlines on a line of their own. This mimics the same option from binutils addr2line, but without the short option variant -p. Since we already use -p to select the process. Example output: eu-addr2line --pretty-print -s -i -f -C -p$(pidof firefox) 0x00007f368c6f8915 mozilla::ReentrantMonitor::Wait(unsigned int) at ReentrantMonitor.h:92 (inlined by) mozilla::ReentrantMonitorAutoEnter::Wait(unsigned int) at ReentrantMonitor.h:190 A couple of tests were added to check the output matches that of binutils addr2line. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Add demangler support.Mark Wielaard2015-05-271-6/+42
| | | | | | | Makes the -C, --demangle option visible and implements it (ignoring the demangle style argument). Adds a new test with sample output. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Add -a, --address. Print address before for each entry.Mark Wielaard2015-05-271-1/+37
| | | | | | Adds test cases with sample output. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Always parse addresses as hex numbers.Mark Wielaard2015-05-271-2/+2
| | | | | | | | We would sometimes interpret input addresses as decimal or octal. That could be confusing and isn't what binutils addr2line does. Be consistent and always treat input addresses as hex. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Split options in input and output format groups.Mark Wielaard2015-05-271-3/+5
| | | | | | | This makes it clear that -j, --section=NAME is about how input is treated, not how the output is formatted. Signed-off-by: Mark Wielaard <[email protected]>
* Drop mtrace calls.Max Filippov2015-05-041-4/+0
| | | | | | | mtrace is a GNU extension not supported by uClibc and it's believed to not be really used. Drop mtrace() calls and #include <mcheck.h>. Signed-off-by: Max Filippov <[email protected]>
* addr2line: Always prefer linkage_name over plain namesJosh Stone2014-12-111-20/+20
| | | | Signed-off-by: Josh Stone <[email protected]>
* addr2line: Iterate scopes for inline's parent functionJosh Stone2014-12-111-1/+17
| | | | | | | | The function which contains an inline might not be the immediate next die scope. For instance, there may be a lexical scope in between. Instead, iterate the remaining scopes until an appropriate tag is found. Signed-off-by: Josh Stone <[email protected]>
* addr2line: handle_address initialize scopes to NULL.Mark Wielaard2014-01-241-1/+1
| | | | | | | | | dwarf_getscopes returns the number of scope DIEs containing a PC address. It returns -1 for errors or 0 if no scopes match PC. If dwarf_getscopes returned 0, then scopes will not be allocated and handle_address might free the uninitialized scopes pointer. Make sure it always has a defined value. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.Mark Wielaard2013-12-201-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some arches like ppc64 use function descriptor values instead of function addresses causing matching of names and addresses to fail when using dwfl_module_getsym or dwfl_module_addrsym. Add ebl hook to resolve any function descriptor values found in non-ET_REL modules. The new function dwfl_module_getsym_info doesn't adjust the symbol value in any way, but returns the adjusted and/or resolved address associated with the symbol separately. The new function dwfl_module_addrinfo resolves against both the address associated with the symbol (which could be the function entry address) value and the adjusted st_value. So that it is easy to resolve and match either function descriptors and/or function entry addresses. Since these new functions also return more information they replace the dwfl_module_getsym_elf and dwfl_module_addrsym_elf functions that never made it into a released elfutils version. addr2line and readelf now use the new functions when looking up functions names. addr2line will now also display the section the address was found in when given -x. Extra testcases were added for both addr2line and the dwflsyms testscase. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Support -i, --inlines output option.Mark Wielaard2013-08-131-20/+120
| | | | | | | | | | | | Show all source locations that caused inline expansion of subroutines at the given address. This can easily be supported by using libdw dwarf_getscopes_die which will give all nested inlined subroutines. When -f, --functions is given also show the function names where the subroutines were inlined. The output matches that of binutils addr2line --inlines. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Remove newline from strings returned by getline.Mark Wielaard2013-08-121-1/+5
| | | | | | | | | | | getline can return strings with a newline as last character when reading from stdin. This could cause confusing symbol lookup failures like: addr2line: cannot find symbol 'foo ' So if the last character of the buf returned by getline is a newline just null-terminate it right there. Also add a new testcase run-addr2line-test.sh. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Cleanup Dwfl when done.Mark Wielaard2012-12-211-0/+1
| | | | | | Make sure addr2line and libdwfl don't leak memory. Signed-off-by: Mark Wielaard <[email protected]>
* Update name, license and contributor policy.Mark Wielaard2012-06-051-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change name from "Red Hat elfutils" to "elfutils". * Update license of standalone tools and test from GPLv2 to GPLv3+. * Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+. * Add Developer Certificate of Origin based contributor policy. top-level: - COPYING: Upgraded from GPLv2 to GPLv3. - CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files. - NEWS: Added note about new contribution and license policy. - Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST. - configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'. backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf: - All files updated to GPLv2/LGPLv3+. Except some very small files (<5 lines) which didn't have any headers at all before, the linker .maps files and the libcpu/defs files which only contain data and libelf/elf.h which comes from glibc and is under LGPLv2+. config: - elfutils.spec.in: Add new License: headers and new %doc files. - Update all license headers to GPLv2/LGPLv3+ for files used by libs. src, tests: - All files updated to GPLv3+. Except for the test bz2 data files, the linker maps and script files and some very small files (<5 lines) that don't have any headers. Signed-off-by: Richard Fontana <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Update copyright yearUlrich Drepper2012-01-211-2/+2
|
* Add dwfl_dwarf_line, addr2line -F to print out more line info bits.Roland McGrath2010-08-241-2/+40
|
* addr2line: Handle SYMBOL without +OFFSET.Roland McGrath2010-05-191-8/+17
|
* addr2line: Honor -s and -A for file names of inline call sites.Roland McGrath2009-04-201-5/+25
|
* Support -j option in addr2line to match binutils.Roland McGrath2009-04-201-41/+57
|
* Move argp_program_version_hook and argp_program_bug_address variablesUlrich Drepper2009-01-171-2/+4
| | | | in all programs into the .rodata section.
* Unpdate copyright in messages.Ulrich Drepper2009-01-011-2/+2
|
* src/Roland McGrath2008-08-071-18/+130
| | | | | | (find_symbol): Likewise. Convert plain number, or handle strings like "(section)+offset" or "symbol+offset".
* propagate from branch 'com.redhat.elfutils.disasm' (head ↵Ulrich Drepper2008-01-021-0/+3
| | | | | | d15b4eb794e81e477f9896fe82a74cb5ecf4514c) to branch 'com.redhat.elfutils' (head eaacbf01f8cc89d043ec6eca9b5e35cb5c4cde06)
* Update copyright year.Ulrich Drepper2008-01-021-1/+1
|
* 2007-08-03 Roland McGrath <[email protected]>Roland McGrath2007-08-031-1/+35
| | | | | | | | | | | * readelf.c (print_string_sections): New variable. (options, parse_opt): Handle --strings/-p to set it. (print_strings): New function. (process_elf_file): Call it under -p. * readelf.c (options): Add hidden aliases --segments, --sections, as taken by binutils readelf.
* Prepare for 0.128 release.Ulrich Drepper2007-06-061-3/+3
| | | | | | Minor fixes. Update gettext files to 0.16.1.
* src/Roland McGrath2007-05-181-1/+2
| | | | | | | | | | | | | | | | | | | 2007-05-18 Roland McGrath <[email protected]> * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with stripped file, so as not to duplicate a section copied in both. * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file. tests/ 2007-05-18 Roland McGrath <[email protected]> * run-strip-test4.sh (stripped, debugfile): Use new reference files. * testfile37.bz2: New data file. * testfile37.debug.bz2: New data file. * run-unstrip-test2.sh: New file. * Makefile.am (TESTS, EXTRA_DIST): Add them.
* Update copyright year.elfutils-0.125Ulrich Drepper2007-01-101-2/+2
|
* Rejigger botcho brancho.Roland McGrath2006-07-121-1/+1
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-2/+2
| | | | | | e5cfdd13aa39dfae16b905fd57ff56ad8a131bb5) to branch 'com.redhat.elfutils' (head 60222fc1981540f15e674b6705fd7a6f628f95a4)
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-2/+22
| | | | | | 1ac619debea0e3ecfd2704e8bdc803c6c893b62a) to branch 'com.redhat.elfutils' (head 830d38d0a2ce24911160a871963f093209e69d9e)
* merge of 2043b4a4bc8f0359b8c216306758ab5900533fdeUlrich Drepper2006-06-101-1/+2
| | | | and fde883376d5d9573d47686c91400d14495518411
* * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entriesUlrich Drepper2006-06-101-2/+1
| | | | | | | | | | | for PLT entries if there is no local definition. * ld.c (parse_option): Handle -z ignore like --as-needed and -z record like --no-as-needed. * ld.h (struct ld_state): Remove ignore_unused_dsos field. * ldgeneric.c (new_generated_scn): Always compute ndt_needed by looping over DSOs. When deciding about adding DT_NEEDED entries use ->as_needed instead of ignore_unused_dsos.
* merge of 74ebb3c081458a7d19c744b155c767262efc47cbUlrich Drepper2006-06-041-1/+2
| | | | and cb87c403367a928f441c3dab11f1ed989884a7f7
* Handle as-needed options.Ulrich Drepper2006-05-311-2/+1
|
* Little clenaup.Ulrich Drepper2006-05-281-1/+2
|
* Fix FSF address. No exception for libdwarf.Ulrich Drepper2006-04-041-1/+1
|
* Prepare for 0.120 release.Ulrich Drepper2006-04-041-2/+2
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-04-041-9/+21
| | | | | | 4f8fc821345feef58624f0aa5b470d4827577d8c) to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
* libdw/Roland McGrath2005-08-271-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-08-27 Roland McGrath <[email protected]> * dwarf_getscopes.c (dwarf_getscopes): Rewritten using __libdw_visit_scopes. * dwarf_getscopes_die.c: New file. * Makefile.am (libdw_a_SOURCES): Add it. * libdw.h: Declare dwarf_getscopes_die. * libdw.map: Bump to 0.115 and add it. * libdw_visit_scopes.c (__libdw_visit_scopes): Pass a struct containing a DIE and its parent pointer, instead of just Dwarf_Die. Take two functions for both preorder and postorder visitors. * libdwP.h: Update decl. (struct Dwarf_Die_Chain): New type. * dwarf_func_inline.c: Update uses. * dwarf_diename.c (dwarf_diename): Use dwarf_attr_integrate. Add INTDEF. * libdwP.h: Add INTDECL. * dwarf_func_name.c (dwarf_func_name): Use dwarf_diename. src/ 2005-08-27 Roland McGrath <[email protected]> * addr2line.c (dwarf_diename_integrate): Function removed. (print_dwarf_function): Use plain dwarf_diename. tests/ 2005-08-27 Roland McGrath <[email protected]> * run-funcscopes.sh: New file. * testfile25.bz2: New data file. * Makefile.am (TESTS, EXTRA_DIST): Add them. 2005-08-26 Roland McGrath <[email protected]> * addrscopes.c (dwarf_diename_integrate): Removed. (print_vars, handle_address): Use plain dwarf_diename. 2005-08-25 Roland McGrath <[email protected]> * funcscopes.c: New file. * Makefile.am (noinst_PROGRAMS): Add it. (funcscopes_LDADD): New variable. * run-addrscopes.sh: Add another case. * testfile24.bz2: New data file. * Makefile.am (EXTRA_DIST): Add it. * addrscopes.c (handle_address): Take new argument IGNORE_INLINES, pass it to dwarf_getscopes. (main): Pass it, true when '=' follows an address.
* merge of 0bdc7517571447282c23ea28a69147eabf574048Roland McGrath2005-08-111-154/+96
| | | | and b0183df71043735ade5c882809fed6c7ca571b2a
* Update DW_LNS_set_epilogue_begin uses to correct misspelling.Roland McGrath2005-08-101-96/+154
|
* Change addr2line to use dwfl_* functions.Ulrich Drepper2005-08-111-154/+96
| | | | Minor strip cleanups.