stack: Add -d, --debugname. Lookup DWARF debuginfo name for frame address.

Includes test that shows -d matches the function name that corresponds to
the actual source line we report with -s for a frame address.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
stack: Initialize -n maxframes to 256 by default.

Make -n default just 256 frames, 2048 was too big. Also Document magic
number used in frames.allocated initialization.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
stack: Add -i, --inlines. Show inlined call frames using DWARF debuginfo.

Using dwarf_getscopes_die we can get all scopes that make up the current
subprogram representing an address. Using the call_file/line/column
attributes we can also show the source locations of these "inlined" calls.
Includes a test that shows that when DWARF debuginfo is available all
inlined function call frames and their source location can be shown.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
Use -Wformat=2 by default for all files.

This just makes sure that all format strings are given as literals to
printf like functions so the compiler can see and check them. Remove
all no_Wformat, add -Wformat=2 unconditionally to AM_CFLAGS.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
backends: Update arm_reloc.def.

The elflint self test now also checks ET_REL files. Update the list of
relocation types to include all known relocations from elf.h.
R_ARM_SWI24 was obsolete and is now named R_ARM_TLS_DESC. The only other
relocation used in the dynamic linker is R_ARM_IRELATIVE.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
backends: arm_cfi SP (r13) is restored from CFA by default.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
backends: Add arm frame_nregs and set_initial_registers_tid.

This allows CFI unwinding for ARM. It relies on having .debug_frame around
which is always the case in our testsuite. All native backtrace tests PASS
on arm if debuginfo (for glibc) is installed on the system. Otherwise the
tests SKIP.

For non-debug unwinding ARM uses EXIDX tables, not .eh_frames, which
would have to be translated to CFI to do unwinding without .debug_frame
available.

Signed-off-by: Mark Wielaard <mjw@redhat.com>