Fix some compiler warnings
Fix a test failure

The test contains hints to users of unw_backtrace() and friends
on how to ensure correctness in a multi-threaded program
Fix a SIGSEGV in test-ptrace.c

./test-ptrace -v resulted in a SIGSEGV.
Fix incorrect return code of unw_get_proc_name

The code for symbol lookup (elfxx.c:lookup_symbol) works by iterating
over symbol tables while maintaing the symbol closest to the supplied
instruction pointer. Whenever this search encountered symbol that was
longer than result buffer, the function returned -UNW_ENOMEM even though
the final symbol wasn't too long.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Make coredump test also test unw_get_proc_name

Signed-off-by: Martin Milata <mmilata@redhat.com>
Add liblzma detection to configure script

Signed-off-by: Martin Milata <mmilata@redhat.com>
MiniDebugInfo test: tests/run-coredump-unwind-mdi

Test that creates MiniDebugInfo-containing binary and then checks if it
can recover the procedure names from its coredump.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Refactor parts of elfxx.c to allow reusing code

Signed-off-by: Martin Milata <mmilata@redhat.com>
Search MiniDebugInfo for procedure names

After searching the normal symbol table, look if the binary contains
.gnu_debugdata section. If it does, run LZMA decompression on it, load
the resulting ELF image into memory and call lookup_symbol() on it
again.

lookup_symbol() is modified so that it takes min_dist as a parameter and
only returns a symbol when it finds one that is closer than indicated by
the parameter.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Fix test-ptrace in automated mode

Tested via:
./test-ptrace
./test-ptrace -v /bin/ls /usr
Fix for test suite build in the separate directory.
Avoid manually coding the rule to build crasher, instead fuddle
the compiler so that even -O2 optimization does not eliminate call
to b().

First, put calls to both a() and b() in the b() into non-tail-recursive
position. Second, as recommended in gcc manual, use asm volatile("");
to prevent further prevent inlining, besides attribute((noinline).
And third, call b() by alias, which current gcc optimizer cannot see
through.

Also, do not dereference NULL in a, and mark the memory access as volatile.
[ Minor portability improvements: asharma@fb.com ]
Use libtool to build libunwind-ptrace
HPPA: fix tdep_put_unwind_info() macro

In file included from mi/Lput_dynamic_unwind_info.c:4:
mi/Gput_dynamic_unwind_info.c:48:40: error: macro "tdep_put_unwind_info" passed 3 arguments, but takes just 2
HPPA: add `global_cache' member to unw_addr_space struct

dwarf/Gparser.c: In function 'get_rs_cache':
dwarf/Gparser.c:522: error: 'struct unw_addr_space' has no member named 'global_cache'
HPPA: include `mempool.h' in `libunwind_i.h'

dwarf/Gfde.c: In function '_Uhppa_dwarf_extract_proc_info_from_fde':
dwarf/Gfde.c:335: warning: implicit declaration of function 'mempool_alloc'
Add PPC namespace checking

PPC is the only architecture that has the get_func_addr() symbol
exported, so add specific checks for this architecture.
Ignore _fbss, _fdata, _ftext and _gp symbols on MIPS
Eliminate unused parameters in tests
Annotate unused parameters in tests

Compiling the tests with -Wextra results to lots of warnings for unused
parameters. Annotate these cases with the `unused' attribute to avoid
the warnings.
Update .gitignore