libdw: Recognize zero terminator to end frame table in dwarf_next_cfi.
authorMark Wielaard <mark@klomp.org>
Thu, 28 Jun 2018 15:53:12 +0000 (17:53 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 29 Jun 2018 17:43:28 +0000 (19:43 +0200)
commit6dd08dc77dfde80efb349bfab4df67b375f47293
treea8c122b109e0b4f394ad2bb6d40b630751b65b93
parentc7a83bf05734e2c20d621678d0f3214475404c55
libdw: Recognize zero terminator to end frame table in dwarf_next_cfi.

When the length is zero this is a the zero terminator that ends the
frame table. Return 1 (end of table) instead of -1 (error) in that case.
We cannot update next_off and don't want to caller to try again.

Add testcase for dwarf_next_cfi to show both .eh_frame and .debug_frame
tables and check consistency (FDEs should point to existing CIEs).
Also add a self check to make sure we can read the table from the just
build elfutils binaries.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_next_cfi.c
tests/ChangeLog
tests/Makefile.am
tests/next_cfi.c [new file with mode: 0644]
tests/run-next-cfi-self.sh [new file with mode: 0755]
tests/run-next-cfi.sh [new file with mode: 0755]