dwarf/Gfind_unwind_table.c: In function '_Ux86_dwarf_find_unwind_table':
dwarf/Gfind_unwind_table.c:223:46: error: 'struct elf_dyn_info' has no member named 'edi'
Fixup commit d93d96ad83 ("Fix compilation
on IA64"), and replace the dwarf_find_unwind_table() call with
tdep_find_unwind_table().
Fixes linkage error on IA64:
../src/.libs/libunwind-coredump.so: undefined reference to `dwarf_find_unwind_table'
Change the way we generate the cursor header files, so that we do not
need to invoke IA64 binaries, which would fail when cross-compiling
libunwind.
Adopt the strategy used in the Linux kernel build system, and parse our
annotated offset information from the assembler file produced by the
compiler.
Program test-coredump-unwind was modified to map backing files based on
virtual addresses instead of segment numbers.
The crasher.c is a program that essentially calls some functions and
then writes to invalid address causing a crash. Before that, it detects
which executables are mapped to which virtual addresses and writes this
information to a file suitable for consumption by test-coredump-unwind.
The mapping information is obtained form /proc/self/maps, so currently
it only works on linux.
The test itself is a shell script, which first runs the program and then
runs test-coredump-unwind on the resulting core and address space
map file to check whether the stack trace obtained from the dump roughly
corresponds to what it should look like.
Signed-off-by: Martin Milata <mmilata@redhat.com>
- Add tdep macro for {dwarf,ia64}_find_unwind_table so that ia64
doesn't try to use dwarf code.
- Fix extraneous #if.
- Fix mistyped filename in Makefile.am.
- Link ia64-specific tests with correct libraries.
Signed-off-by: Martin Milata <mmilata@redhat.com>
This reverts commit c9c5a40be1.
dwarf_get() returns 0 on success. We should continue unwinding
in that case.
TBD: investigate test-ptrace failure on some platforms.
If dwarf_get returns 0 (indicating the end of call chain), we should
not override the return value to 1. This may result in the caller
continuing to unwind and getting spurious errors.
In the commit d04dc94cc2, the check for
dwarf.ip == 0 was removed from non-dwarf walker in x86_64 version of
unw_step(). Apparently this broke the detection of the end of frame
chain when NULL %rbp is specified, because the case just marked
dwarf.ip as 0. Explicitly set ret to 0 to indicate the end of
iteration.
Older kernels interpret the pid argument of the process information
sysctls as pid only. If libunwind UPT consumer passed tid to _UPT_create,
tdep_get_elf_image() returns error due to sysctls failure. Provide a
slow workaround by searching for a process owning the supplied tid if
sysctl returned ESRCH.
Currently the expression evaluation always succeeds,
and possible error is not propagated to the caller.
The ',' operator makes the condition always return 0.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Paul Pluzhnikov <ppluzhnikov@google.com>
ALIGN lets you align pointers and STRUCT_MEMBER lets you get
structure members at a specific offset.
These are useful in general, and will be needed for the coredump notes
cleanup work.
These let you get the pid and the current signal from the coredump.
This isn't strictly unwind related, but these are trivial to implement
as we have the info, and you almost always want these when you're
printing a backtrace from a core file.
Move ptrace-independent code from src/ptrace/_UPT_find_proc_info.c
to src/dwarf/{G,L}find_unwind_table.c. Name this moved function
dwarf_find_unwind_table().
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This is a common part of struct UPT_info
and struct UCD_info (to be introduced later).
Make _UPTi_find_unwind_table function operate only on this part
of struct UPT_info.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>