summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: backtrace-subr.sh (check_native_core) should check core file name.Matthias Klose2014-01-072-0/+11
| | | | | | | Needed when /proc/sys/kernel/core_uses_pid is set to 0. Try to rename the core file, and if it does still fail, skip the test. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Don't use ptrace detach stopped trick. Raise can return.Mark Wielaard2014-01-044-25/+15
| | | | | | | | | | On older kernels the ptrace detach stop trick doesn't work reliably. Just keep the child processes attached and stopped during the tests, dwfl_linux_proc_attach will handle that fine now. Also on older kernels raise would sometimes return anyway and cause a spurious assert. Just ignore it. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace-subr.sh skip check_native_core test if core ulimit fails.Mark Wielaard2014-01-042-1/+7
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Simplify backtrace-dwarf (gcc cleanup-13.c) testcase.Mark Wielaard2014-01-042-21/+9
| | | | | | | | The testcase originally came from GCC which was testing the runtime unwinder using _Unwind_ForcedUnwind. Since we are using our own external unwinder we can just abort at the right place and unwind from there. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Add aarch64 abi_cfi.Mark Wielaard2014-01-034-1/+83
| | | | | | | | Setup initial CIE values for aarch64 for use with dwarf_frame functions. Register info prefix should be the empty string (not NULL) when not used. Add an EM_AARCH64 testcase to tests/run-addrcfi.sh to check both issues. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Add dwfl_core_file_attach and dwfl_linux_proc_attach.Mark Wielaard2013-12-313-0/+18
| | | | | | | | | | | | | | Rewrite __libdwfl_attach_state_for_pid and __libdwfl_attach_state_for_core as public functions and don't call them from dwfl_linux_proc_report and dwfl_core_file_report anymore. This lets the user attach state explicitly independ from how the dwfl modules have been reported. Since attaching state is an explicit action now the error can be returned directly and we don't need to keep track of process_attach_error. dwfl_linux_proc_attach lets the user can tell libdwfl whether caller takes care of ptrace attaching and stopping the threads under inspection, or whether the callback needs to take care of that and detaching again. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Add dwfl_getthread_frames.Mark Wielaard2013-12-231-0/+1
| | | | | | | | | | | | | | | | dwfl_getthread_frames is a convenience function for when the user is only interested in one specific thread id of a process. It can be implemented by a simple wrapper function that removes an extra callback layer just to filter on thread id. But it also provides an optimized path to getting access to just one particular Dwfl_Thread of the Dwfl process by providing and (optional) new callback for the state provider. The pid_thread_callbacks now provide an (optional) pid_getthread that doesn't need to travers all threads anymore. Which is implemented for the linux-pid-attach provider. stack now uses this to implement a new '-1' option that shows just one specific thread of a process. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: backtrace.c only check we caught the last instruction on x86_64.Mark Wielaard2013-12-212-1/+12
| | | | | | | | | | On some architectures gcc might introduce some "padding instructions" at the end of the function (like on ppc64). So only assert we are at the last instruction of backtracegen if on x86_64 native. In theory the assert could even fail on that architectures, but in practice it doesn't and it is a nice test to have. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.Mark Wielaard2013-12-2017-11/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <mjw@redhat.com>
* unwinder: s390 and s390xJan Kratochvil2013-12-188-2/+61
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Remove tests/backtrace-dwarf.c unused code.Jan Kratochvil2013-12-172-40/+5
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* unwinder: ppc and ppc64Jan Kratochvil2013-12-155-2/+34
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* tests: Add backtrace_child_biarch_SOURCES to make distcheck happy.Mark Wielaard2013-12-132-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Disable valgrind for core dumping and for self-introspecting tests.Mark Wielaard2013-12-135-1/+30
| | | | | | | | | | | | | | | The only tests that fork and exec are those that will then try to ptrace attach the child for unwind testing. That won't work when the child is also running under valgrind. So remove --trace-children=yes. Also disable valgrind while dumping a core or for tests that try to inspect their own state. They will get confused otherwise finding pieces of valgrind in their maps. Note we still seem to hit the following valgrind bug because the way we map and unmap some shared libraries gets valgrind confused: https://bugs.kde.org/show_bug.cgi?id=327427 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Handle empty location expression for (indirect) DIE locations.Mark Wielaard2013-12-132-1/+6
| | | | | | | | | | When dwarf_getlocation_implicit_pointer and dwarf_getlocation_attr refer to a DIE that doesn't contain a DW_AT_location then don't generate an error, but return an empty location expression to signal the actual value pointed to is not available. This isn't invalid DWARF. Also make sure that __libdw_intern_expression handles empty location expressions. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix test FAIL with -O2Jan Kratochvil2013-12-052-1/+8
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* tests: SKIP backtrace-data and backtrace-dwarf on unsupported arches.Mark Wielaard2013-12-053-3/+14
| | | | | | | | | run-backtrace-data.sh did check stderr whether the arch was unsupported but the test didn't print that message yet. backtrace-dwarf did print the message but was missing a check_unsupported test. Also add an explicit check_main test for backtrace-dwarf. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: automake 1.13 compatibility fix.Mark Wielaard2013-12-042-1/+5
| | | | | | | | | tests/Makefile.am:65: warning: deprecated feature: target 'backtrace-child-biarch' overrides 'backtrace-child-biarch$(EXEEXT)' tests/Makefile.am:65: change your target to read 'backtrace-child-biarch$(EXEEXT)' Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Tests for unwinder of x86*.Jan Kratochvil2013-12-0220-3/+1889
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* libdwfl: Add dwfl_module_addrsym_elf and dwfl_module_getsym_elf.Mark Wielaard2013-11-273-59/+127
| | | | | | | | | | | 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>
* 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-2610-6/+1214
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* libdwfl: Fix and test aux_sym address_sync with relocated ELFJosh Stone2013-11-185-0/+18
| | | | | | | | | | 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>
* Check for prefixed ar, readelf, and nmMichael Forney2013-11-053-3/+10
| | | | | | | | 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>
* 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>
* libdw: Handle dwz multi files correctly in dwarf_getfuncs.Mark Wielaard2013-10-225-1/+69
| | | | | | | | 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-223-3/+60
| | | | | | | | | | | | | 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>
* backends: ppc_abi_cfi reg1 use DW_CFA_val_offset not DW_CFA_val_expression.Mark Wielaard2013-10-072-2/+7
| | | | | | | | | | | | | | | 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-034-1/+102
| | | | | | | | | | | | 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>
* Show contents NT_FILE core note in readelfPetr Machata2013-09-302-0/+16
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Show contents NT_SIGINFO core note in readelfPetr Machata2013-09-304-2/+65
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* libdw: Make dwarf_getfuncs find all (defining) DW_TAG_subprogram DIEs.Mark Wielaard2013-09-246-4/+75
| | | | | | | | | | | | | | | | | | | | | | | | dwarf_getfuncs used to return only the DW_TAG_subprogram DIEs that were direct children of the given CU. This is normally how GCC outputs the subprogram DIEs. But not always. For nested functions the subprogram DIE is placed under the code construct DIE where it is nested. Other compilers might output the defining subprogram DIE of a C++ class function under the DW_TAG_namespace DIE where it was defined. Both such constructs seem allowed by the DWARF specification. So just searching the CU DIE children was wrong. To find all (defining) subprogram DIEs in a CU dwarf_getfuncs should use __libdw_visit_scopes to walk the tree for all DIEs that can contain subprograms as children. The only tricky part is making sure the offset returned and used when the callback returns DWARF_CB_ABORT is correct and the search continues at the right spot in the CU DIE tree. This operation now needs to rewalk the whole tree. Two new testcases were added that fail without this patch. And the allfcts test was tweaked so that it always returns DWARF_CB_ABORT from its callback to make sure the offset handling is correct. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add new varlocs test for dwarf_getlocation* functions.Mark Wielaard2013-09-0614-3/+1064
| | | | | | | | | | | | This tests the new dwarf_getlocations, dwarf_getlocation_attr and dwarf_getlocation_die functions. But it is also an example of how to handle location expressions and which libdw functions can be used to access all information required to interpret each DW_OP. It might make sense to extend this test/example into a program that verifies various properties of DWARF expressions. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Hook abi_cfi for arm.Mark Wielaard2013-09-034-1/+84
| | | | | | | | | | | | | | | | | | | | | | New arm_abi_cfi that defines initial CFA, rules for callee-saved regs, including VFP ones and return register. Note the DWARF abi extension for ARM says that "registers intentionally unused" should also be initialized as if by DW_CFA_same_value. The example given is "an integer-only function might be included in one executable file for targets with VFP and another for targets without". We don't currently do this yet. See the DWARF and calling convention documents: DWARF for the ARM Architecture ABI r2.09 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040b/IHI0040B_aadwarf.pdf Procedure Call Standard for the ARM Architecture ABI r2.09 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf Also adds addrcfi arm testcase. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add s390 and s390x addrcfi testcases.Mark Wielaard2013-09-036-1/+172
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add ppc32 and ppc64 addrcfi testcases.Mark Wielaard2013-09-036-3/+2096
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add run-addrcfi.sh test for libdw cfi dwarf_frame_* functions.Mark Wielaard2013-09-024-6/+298
| | | | | | | | | | | | | | | | | We require architecture backends to implement the ebl abi_cfi hook to provide the ABI's default CFI program as used by the libdw dwarf cfi functions. There is the addrcfi test program that prints the return address, cfa location expression and register states as returned by various dwarf_cfi_* and dwarf_frame functions. But that has to be run by hand. The new run-addrcfi.sh tests hooks addrcfi up to some existing architecture specific test files and known addresses to more easily (and automaticly) check that the default CFI program is implemented correctly and to test the libdw cfi frame info functionality. Only i386 and x86_64 are tested for now since other backends don't have the abi_cfi hook yet. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* addr2line: Support -i, --inlines output option.Mark Wielaard2013-08-134-2/+157
| | | | | | | | | | | | 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 <mjw@redhat.com>
* addr2line: Remove newline from strings returned by getline.Mark Wielaard2013-08-123-2/+82
| | | | | | | | | | | 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 <mjw@redhat.com>
* Fix false match of non-build-id disk library to build-id memory library.Jan Kratochvil2013-07-232-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch: Use DT_DEBUG library search first. 8ff862960efb648cdff647d7fad1be5acffe9b11 [patch 2/2] Fix loading core files without build-ids https://lists.fedorahosted.org/pipermail/elfutils-devel/2013-April/003031.html [patch 2/2 v2] Fix loading core files without build-ids https://lists.fedorahosted.org/pipermail/elfutils-devel/2013-May/003065.html has PASS->FAIL regression on CentOS-5 for run-unstrip-n.sh: -actual on CentOS-5 +expected by testcase -0xf77b3000+0x822c - /lib/librt.so.1 - librt.so.1 -0xf7603000+0x15c5c4 - /lib/libc.so.6 - libc.so.6 -0xf75e9000+0x191e4 - /lib/libpthread.so.0 - libpthread.so.0 -0xf77d7000+0x1c670 - /lib/ld-linux.so.2 - ld-linux.so.2 0x8048000+0x2000 f1c600bc36cb91bf01f9a63a634ecb79aa4c3199@0x8048178 . - [exe] +0xf75e9000+0x1a000 29a103420abe341e92072fb14274e250e4072148@0xf75e9164 - - libpthread.so.0 +0xf7603000+0x1b0000 0b9bf374699e141e5dfc14757ff42b8c2373b4de@0xf7603184 - - libc.so.6 +0xf77b3000+0x9000 c6c5b5e35ab9589d4762ac85b4bd56b1b2720e37@0xf77b3164 - - librt.so.1 0xf77d6000+0x1000 676560b1b765cde9c2e53f134f4ee354ea894747@0xf77d6210 . - linux-gate.so.1 +0xf77d7000+0x21000 6d2cb32650054f1c176d01d48713a4a5e5e84c1a@0xf77d7124 - - ld-linux.so.2 Therefore elfutils now incorrectly matches on-disk file without build-id to an in-core (in-memory) file with build-id. In fact due to its known FIXME: This verification gives false positive if in-core ELF had build-id but on-disk ELF does not have any. But we cannot reliably find ELF header and/or the ELF build id just from the link map (and checking core segments is also not reliable). */ So it probably should not be so ignorable as I did, one may want to analyze build-id core files on CentOS-5, not sure. In fact it can be fixed, when we find in dwfl_segment_report_module a module with build-id with conflicts in its address range with existing non-build-id dwfl_link_map_report module we should prefer the build-id module instead. The problem is that once Dwfl_Module is added to Dwfl it cannot be easily removed. Originally elfutils called dwfl_segment_report_module first and then dwfl_link_map_report. Currently the order is dwfl_link_map_report and then dwfl_segment_report_module only for modules missing from dwfl_link_map_report. Patch below unfortunately needs bidirectional negotiation between the two functions, therefore dwfl_link_map_report now no longer adds Dwfl_Modules to Dwfl but it only stores information about them to r_debug_info_module. This information is filtered then by dwfl_segment_report_module and only filtered r_debug_info_module entries get finally added to Dwfl (in dwfl_core_file_report). NT_FILE would make all this magic easy but it is true that on CentOS-5 it definitely does not exist. libdwfl/ 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> * core-file.c (clear_r_debug_info): Close also ELF and FD. (dwfl_core_file_report): Call __libdwfl_report_elf for R_DEBUG_INFO.MODULE. * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from code of ... (__libdwfl_report_elf): ... this function. Call it. * dwfl_segment_report_module.c: Include unistd.h. (dwfl_segment_report_module): Use basename for MODULE->NAME. Clear MODULE if it has no build-id and we have segment with build-id. Ignore this segment only if MODULE still contains valid ELF. * libdwflP.h (__libdwfl_elf_address_range): New declaration. (struct r_debug_info_module): New fields fd, elf, l_addr, start, end and disk_file_has_build_id. (dwfl_link_map_report): Extend the comment. * link_map.c (report_r_debug): Extend the comment. Always fill in new r_debug_info_module. Initialize also the new r_debug_info_module fields. Remove one FIXME comment. Call __libdwfl_elf_address_range instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL. tests/ 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> * run-unstrip-n.sh (test-core.*): Ignore libc.so.6 entry and order of the entries. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* tests EXTRA_DIST typo, forgot extension in testfilenolines.bz2.Mark Wielaard2013-07-022-1/+6
|
* Use DT_DEBUG library search first.Jan Kratochvil2013-05-307-10/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libdwfl/ 2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com> * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set executable_for_core before calling dwfl_core_file_report. * core-file.c (clear_r_debug_info): New function. (dwfl_core_file_report): Move raw segments reporting lower. New variable r_debug_info, pass it to dwfl_segment_report_module. Call clear_r_debug_info in the end. Return sum of LISTED and SNIFFED. * dwfl_module_build_id.c (check_notes): Move into __libdwfl_find_elf_build_id. (__libdwfl_find_build_id): Rename to ... (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits, build_id_elfaddr and build_id_len. Verify MOD vs. ELF. (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and set, rename data_vaddr to data_elfaddr. Do not call found_build_id. (__libdwfl_find_elf_build_id): Update the check_notes caller, do not adjust its data_elfaddr parameter. (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id. * dwfl_segment_report_module.c (dwfl_segment_report_module): New parameter r_debug_info. New variable name_is_final. Adjust addresses according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL. Do not overwrite NAME by SONAME if NAME_IS_FINAL. * libdwflP.h (__libdwfl_find_elf_build_id): New declaration. (struct r_debug_info_module, struct r_debug_info): New definitions. (dwfl_segment_report_module, dwfl_link_map_report): Add parameter r_debug_info. * link_map.c: Include fcntl.h. (report_r_debug): Add parameter r_debug_info, describe it in the function comment. Delete dwfl_addrmodule call and its dependent code. Verify build-id before calling dwfl_report_elf, also supply executable_for_core to it. Store r_debug_info->module info when appropriate. (dwfl_link_map_report): Add parameter r_debug_info. New variable in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug caller parameters. tests/ 2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.am (EXTRA_DIST): Add test-core-lib.so.bz2, test-core.core.bz2 and test-core.exec.bz2. * run-addrname-test.sh: New test for these files. * run-unstrip-n.sh: Update expected output. New test for these files. * test-core-lib.so.bz2: New file. * test-core.core.bz2: New file. * test-core.exec.bz2: New file. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* libdw: dwarf_getsrclines don't set end_sequence when there are no lines.Mark Wielaard2013-05-054-3/+37
| | | | | | | | Some CUs might only have a file list, but no actual source lines in their statement list. Only set end_sequence at the end of the source lines list if there are actually lines. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Add parameter add_p_vaddr to dwfl_report_elf.Jan Kratochvil2013-05-052-1/+5
| | | | | | | | | | | | | | | | | | | | | | libdwfl/ * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr. Set it to true for ET_EXEC and ET_CORE. Provide alternative setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE. (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add NEW_VERSION. (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with COMPAT_VERSION. * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it. * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr. * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf. * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for dwfl_report_elf. * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf. tests/ * dwfl-report-elf-align.c: Use false add_p_vaddr for dwfl_report_elf. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* tests: Don't use pushd or popd, just use cd to change working directory.Mark Wielaard2013-04-292-2/+7
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Tests that override EXIT (0) trap need to cleanup themselves.Mark Wielaard2013-04-293-4/+24
| | | | | | | | Since trap handlers don't nest tests that install their own EXIT (0) trap handler need to cleanup themselves. Add an exit_cleanup helper function to test-subr.sh that can be used by run-native-test.sh to exit cleanly. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: All update tests should use unique temporary file names and cleanup.Mark Wielaard2013-04-285-4/+20
| | | | | | | | All update tests used the same temporary file name xxx. And only update4 would clean up this file. Now that tests can run in parallel make sure all temporary names are unique and every test cleans up their own files. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add various files to tempfiles so they are always cleaned up.Mark Wielaard2013-04-275-8/+16
| | | | | | | | Various tests tried to rm their own temporary files. That could mean those files weren't properly cleaned up if the testcase unexpectedly failed. Add them to tempfiles to make sure they are always cleaned up by test-subr.sh. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Enable automake parallel-tests for make check.Mark Wielaard2013-04-2768-183/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parallel-tests option was introduced in automake 1.11 and is the default since automake 1.13. All tests can now be ran in parallel with make check -j. To enable this all tests are ran in their own temporary directory so they don't stomp on each others input or output files. On my machine (4 cores) make check takes ~20 seconds, but now with make check -j8 takes only ~4 seconds. ChangeLog: * configure.ac (AM_INIT_AUTOMAKE): Request parallel-tests. tests/ChangeLog: * Makefile.am (installed_TESTS_ENVIRONMENT): Export environment, remove wrapper. (TESTS_ENVIRONMENT): Likewise. (installed_LOG_COMPILER): New variable defining wrapper. (LOG_COMPILER): Likewise. * run-*.sh: Fixup location of input and output files. * test-subr.sh: Create test_dir, pushd to execute test in. (trap): Remove test_dir. (testfiles): Use abs_srcdir. (installed_testrun): Match on abs_builddir or abs_top_builddir. (self_test_files): Adjust path. Signed-off-by: Mark Wielaard <mjw@redhat.com>