summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* unwinder: ppc and ppc64jankratochvil/ppc64bidir-unwindppcJan Kratochvil2013-12-0319-7/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backends/ 2013-11-10 Jan Kratochvil <jan.kratochvil@redhat.com> unwinder: ppc and ppc64 * Makefile.am (ppc_SRCS, ppc64_SRCS): Add ppc_initreg.c. * ppc64_init.c (ppc64_init): Initialize also frame_nregs, set_initial_registers_tid and dwarf_to_regno. * ppc_corenote.c (PRSTATUS_REGSET_ITEMS) <nip>: Set PC_REGISTER. * ppc_init.c (ppc64_init): Initialize also frame_nregs, set_initial_registers_tid and dwarf_to_regno. * ppc_initreg.c: New file. libdwfl/ 2013-11-10 Jan Kratochvil <jan.kratochvil@redhat.com> unwinder: ppc and ppc64 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set): Call ebl_dwarf_to_regno. * linux-core-attach.c (core_set_initial_registers): Implement pc_register support. * linux-pid-attach.c (pid_thread_state_registers_cb): Implement FIRSTREG -1. libebl/ 2013-11-10 Jan Kratochvil <jan.kratochvil@redhat.com> unwinder: ppc and ppc64 * Makefile.am (gen_SOURCES): Add ebldwarftoregno.c. * ebl-hooks.h (dwarf_to_regno): New. * ebldwarftoregno.c: New file. * libebl.h (Ebl_Core_Item): New field pc_register. (ebl_tid_registers_t): Add FIRSTREG -1 to the comment. (ebl_dwarf_to_regno): New. tests/ 2013-11-10 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.am (TESTS): Add run-backtrace-core-ppc64.sh and run-backtrace-core-ppc.sh. (EXTRA_DIST): Add backtrace.ppc.core.bz2, backtrace.ppc.exec.bz2, backtrace.ppc64.core.bz2, backtrace.ppc64.exec.bz2, run-backtrace-core-ppc64.sh and run-backtrace-core-ppc.sh. * backtrace.ppc.core.bz2: New file. * backtrace.ppc.exec.bz2: New file. * backtrace.ppc64.core.bz2: New file. * backtrace.ppc64.exec.bz2: New file. * run-backtrace-core-ppc.sh: New file. * run-backtrace-core-ppc64.sh: New file. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Provide virtual symbols for ppc64 function descriptorsjankratochvil/ppc64bidirJan Kratochvil2013-12-0218-25/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backends/ 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> Provide virtual symbols for ppc64 function descriptors. * Makefile.am (ppc64_SRCS): Add ppc64_get_symbol.c. * ppc64_get_symbol.c: New file. * ppc64_init.c (ppc64_init): Install init_symbols, get_symbol and destr. libdwfl/ 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> * dwfl_module_addrsym.c (dwfl_module_addrsym): Adjust FIRST_GLOBAL also for EBL_FIRST_GLOBAL. * dwfl_module_getdwarf.c (getsym_helper): New function. (find_symtab): Call also ebl_init_symbols. (dwfl_module_getsymtab): Count also EBL_SYMENTS. * dwfl_module_getsym.c (dwfl_module_getsym_elf): Count also EBL_FIRST_GLOBAL, EBL_SYMENTS. Call also ebl_get_symbol. * libdwflP.h (DWFL_ERRORS): Add INVALID_INDEX. (struct Dwfl_Module): Add fields ebl_syments and ebl_first_global. libebl/ 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> Provide virtual symbols for ppc64 function descriptors. * Makefile.am (gen_SOURCES): Add eblgetsymbol.c. * ebl-hooks.h (init_symbols, get_symbol): New. * eblgetsymbol.c: New file. * libebl.h (ebl_getsym_t): New definition. (ebl_init_symbols, ebl_get_symbol): New declarations. * libeblP.h (struct ebl): New field backend. tests/ 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> Provide virtual symbols for ppc64 function descriptors. * Makefile.am (EXTRA_DIST): Add testfile66.bz2 and testfile66.core.bz2. * dwflsyms.c (list_syms): Remove unused from parameter mod_name. Print error on dwfl_module_getsymtab error. * run-addrname-test.sh (testfile66, testfile66.core): New tests. * run-dwflsyms.sh (testfile66, testfile66.core, hello_ppc64.ko): New tests. * testfile66.bz2: New file. * testfile66.core.bz2: New file. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Tests for unwinder of x86*.Jan Kratochvil2013-12-0224-7/+1901
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Introduce process_attach_error.Jan Kratochvil2013-11-305-21/+47
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* libdwfl: Add dwfl_module_addrsym_elf and dwfl_module_getsym_elf.Mark Wielaard2013-11-2712-108/+243
| | | | | | | | | | | Introduce two new functions that also return the elf associated with a symbol to make symbol section indexing work for non-special sections. Simplify code by removing dwfl_file where appropriate and just track Elf directly. Document limitations of shndx with existing dwfl_module_addrsym and dwfl_module_getsym. Extend dwflsyms testcase to check some more symbol and section (index) properties. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Mark new dwfl functions with version ELFUTILS_0.158.Mark Wielaard2013-11-262-10/+19
| | | | | | | | It took two versions to get the new thread state and unwind dwfl functions in. Make sure they carry the latest elfutils symbol version in which they were actually added. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Makefile.am (EXTRA_DIST): Add run-funcretval.sh.Mark Wielaard2013-11-262-1/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Support AArch64 architecturePetr Machata2013-11-2623-15/+2194
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Support new 'h' core note item format for hidden fieldsPetr Machata2013-11-222-0/+8
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Fix non-build-id core files on build-id systemJan Kratochvil2013-11-212-3/+11
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Verify file vs. core build-id, when both availableJan Kratochvil2013-11-212-5/+31
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* link_map: Use proper bias, not l_addrJan Kratochvil2013-11-214-9/+27
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Compatibility with older kernels such as RHEL-6.Jan Kratochvil2013-11-192-4/+20
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* libdwfl: Fix and test aux_sym address_sync with relocated ELFJosh Stone2013-11-187-14/+54
| | | | | | | | | | The aux_sym address_sync already worked with a full prelink, which has .gnu.prelink_undo, but it failed on plain relocations with prelink -r. Now it uses the difference in ehdr.e_entry as a first offset guess, and the tests confirm this seems to work fine. Signed-off-by: Josh Stone <jistone@redhat.com>
* tests: Fix broken dwflsyms tests, extend test and add prelink tests.Mark Wielaard2013-11-169-103/+275
| | | | | | | | | | | The two test files that contains minisymtab tables and the expected test output were wrongly generated. Also prelink tests were missing to check that a prelinked main ELF file with separate debug or minisyms generated correctly adjusted symbol values. The dwflsyms test was also extended to check print and check the result of dwfl_module_relocate_address. Reported-by: Josh Stone <jistone@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Update m4/ChangeLog for m4/biarch.m4 authorship.Jan Kratochvil2013-11-151-1/+2
|
* Code cleanup: Remove const in prototypeJan Kratochvil2013-11-146-10/+19
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Fix dwfl_attach_state machine->elfJan Kratochvil2013-11-145-13/+25
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Provide __libdwfl_module_getsym to get dwfl_file *Jan Kratochvil2013-11-134-18/+35
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Fix dwfl_module_addrsym for minidebuginfoJan Kratochvil2013-11-132-7/+28
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* stack: Add basic argp version and bug definitions.Mark Wielaard2013-11-112-0/+21
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libelf: Only memcpy ehdr back when not already directly mmapped.Mark Wielaard2013-11-112-1/+6
| | | | | | | | | | When the elf file is mmapped ehdr can still point to ehdr_mem if the address is unaligned. In such cases we do need to memcpy the ehdr back to the file. We shouldn't when ehdr already comes directly from the mmapped file, because that would cause an memcpy call with overlapping addresses (ehdr being copied directly over itself). Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix some (harmless) cppcheck warnings.Mark Wielaard2013-11-095-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | [dwarf_getaranges.c:149]: (warning) Ineffective statement similar to '*A++;'. Did you intend to write '(*A)++;'? There was already an XXX statement that we weren't using the result. Explicitly read the segment_size and check it is zero. And report an error if it isn't, since we aren't prepared to handle such a case. [arlib.c:62]: (error) Uninitialized variable: tmpbuf [arlib.c:124]: (error) Uninitialized variable: tmpbuf cppcheck is wrong. tmpbuf is initialized in the snprintf call whose result is use in the same memcpy call. It does make the code less readable and harder to understand. So explicitly split the snprintf and memcpy calls. [nm.c:766]: (warning) Assert statement modifies 'cnt'. The cnt variable was only used for this assert sanity check. But it is bad style to do have side effects inside an assert statement. Increase cnt after the assert. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Unwinder for x86*.Jan Kratochvil2013-11-0736-32/+2623
| | | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* dwfl_core_file_report: Remove the use of MAX.Jan Kratochvil2013-11-072-1/+5
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* dwfl_core_file_report: Fix a regression of dwfl_core_file_report retvalJan Kratochvil2013-11-072-4/+10
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* dwfl_core_file_report: Fix core files for re-prelink-ed filesJan Kratochvil2013-11-074-3/+36
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* dwfl_core_file_report: Code cleanup: Reindentation.Jan Kratochvil2013-11-072-28/+35
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* configure.ac: Warn when --enable-dwz=no, but /usr/lib/debug/.dwz exists.Mark Wielaard2013-11-062-0/+7
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* configure.ac: Add warning that --enable-thread-safety is experimental.Mark Wielaard2013-11-062-2/+10
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libelf: Write all section headers if elf flags contains ELF_F_DIRTY.Mark Wielaard2013-11-052-2/+9
| | | | | | | | | When ehdr e_shoff changes, elf flags is set dirty. This indicates that the section header moved because sections were added/removed or changed in size. Reported-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix expansion of libdw_a_LIBADDMichael Forney2013-11-052-1/+7
| | | | | | | | | | | | | | | | | At least with automake-1.14, libdw_a_LIBADD currently expands to: <snip> am__DEPENDENCIES_1 = libdw_a_DEPENDENCIES = $(addprefix ../libdwfl/,$(shell \ $(am__DEPENDENCIES_1) t ../libdwfl/libdwfl.a)) <snip> libdw_a_LIBADD = $(addprefix ../libdwfl/,$(shell $(AR) t ../libdwfl/libdwfl.a)) This leads to the spurious error message: make[2]: t: Command not found Signed-off-by: Michael Forney <mforney@mforney.org>
* Check for prefixed ar, readelf, and nmMichael Forney2013-11-0512-7/+34
| | | | | | | | Sometimes with cross-compile toolchains, the tools are prefixed with the target arch. Using AC_CHECK_TOOL looks for tools named like this. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Solve comparison between signed and unsigned compiler warning.Mark Wielaard2013-11-052-2/+8
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: allfcts.c (main): Correct dwarf_getfuncs return value check.Mark Wielaard2013-11-052-1/+5
| | | | | | | | The return value of dwarf_getfuncs is a ptrdiff_t that is zero on success, or non-zero (an offset to continue the search) when the callback returned DWARF_CB_ABORT or on error. When an error occurs dwarf_errno is set. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* README: Fix compatbile -> compatible typo.Mark Wielaard2013-11-041-1/+1
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* README: Document that tools and libraries should be upgraded together.Mark Wielaard2013-11-041-0/+7
| | | | | | | | | | On some distributions it was possible to upgrade separate parts of elfutils individually. That causes hard to debug issues since some tools (e.g. readelf) and some libraries (e.g. libdw) depend on libelf internal data structures, which could be different between versions (or when configured with different flags). So explicitly document that they should always be upgraded together. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix executable_for_core for non-dwfl_standard_argpJan Kratochvil2013-10-308-9/+62
| | | | | | | | | | | | | | | | | | | | | | | | | ./ 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com> * NEWS (Version 0.158): New. libdw/ 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com> * libdw.map (ELFUTILS_0.158): New. libdwfl/ 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com> * argp-std.c (parse_opt): Use executable parameter of dwfl_core_file_report. * core-file.c (dwfl_core_file_report): Add parameter executable. Set it to DWFL. Add NEW_VERSION for it. (_compat_without_executable_dwfl_core_file_report): New. Twice. * libdwfl.h (dwfl_core_file_report): Add parameter executable, update the function comment. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* libdw: Handle dwz multi files correctly in dwarf_getfuncs.Mark Wielaard2013-10-227-14/+90
| | | | | | | | Don't use DIE offsets, but use their addresses to make sure they are unique. Include test cases where main and alt file have subprograms at same offsets. Reported-by: Josh Stone <jistone@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Don't report and abort on non-file mappings in maps.Mark Wielaard2013-10-225-5/+67
| | | | | | | | | | | | | proc_maps_report, used for -p or -M, could report modules with names that were not absolute file names (and not the special vdso marker). dwfl_linux_proc_find_elf would abort on such names. This isn't a very nice thing to do in a library. Make sure only real (absolute) file mappings are reported and don't abort when unexpected file names are found, just report failure. Test case with some examples as found in Linux /proc/PID/maps added. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* ar: Correct operation check when instance_specifed is set.Mark Wielaard2013-10-182-1/+5
| | | | | Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Update Ukrainian translationYuri Chornoivan2013-10-101-48/+54
| | | | Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
* backends: ppc_abi_cfi reg1 use DW_CFA_val_offset not DW_CFA_val_expression.Mark Wielaard2013-10-078-3/+32
| | | | | | | | | | | | | | | Register rules using expressions are stored using an offset from the start of the .eh_frame or .debug_frame ELF section data. Since abi_cfi rules aren't stored in those ELF sections they should use neither DW_CFA_expression nor DW_CFA_val_expression. The only backend that used DW_CFA_val_expression was ppc_cfi.c. It was easier to express the same rule using DW_CFA_val_offset than to change the code to handle register rules using expressions. On most architectures this did work by accident. See the definition of struct dwarf_frame_register value in libdw/cfi.h to see why. But on ia64 the abi_cfi data and actual frame data were placed too far apart and caused a crash in tests/run-addrcfi.sh for ppc32. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Make sure that every debug_types sig8 is hashedJosh Stone2013-10-037-2/+111
| | | | | | | | | | | | When dwarf_formref_die can't find a sig8 in the hash, it walks __libdw_intern_next_unit, and was then adding those to the hash. However, if dwarf_offdie_types is called earlier, which also uses that next_unit, then they are missed from the hash (and never revisited). This patch makes __libdw_intern_next_unit do the sig8 hash insert, so no type unit is ever missed. Signed-off-by: Josh Stone <jistone@redhat.com>
* Update elf.h from glibcPetr Machata2013-10-012-2/+154
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* 0.157 release updates for NEWS, elfutils.spec.in and .po files.elfutils-0.157Mark Wielaard2013-09-3010-1977/+2009
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Show contents NT_FILE core note in readelfPetr Machata2013-09-304-4/+84
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Show contents NT_SIGINFO core note in readelfPetr Machata2013-09-306-2/+174
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* libdw: Fix compiler warnings on 32-bit.Mark Wielaard2013-09-303-6/+17
| | | | | | | | Don't cast directly to/from Dwarf_Word (uint64_t) to/from pointers, but use uintptr_t as intermediary to prevent cast to pointer from integer of different size warnings. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Recognize names of some new core note types in ebl_core_note_type_namePetr Machata2013-09-272-1/+11
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>