Hi,
This patch widens out libunwind interface to accept either eh_frame or
debug_frame tables and adds support for parsing debug_frame data. It
currently does a linear search through the data to find the right fde
and corresponding cie by making the right adjustments. Although it does
find the right fde covering the ip ranges, it doesn't always run the cfi
program correctly. So for now the default is still the default and
debug_frame is only used as fallback when eh_frame data cannot be found
(that can be changed in a simple if statement, see the FIXME in UnwindH
- that will however give a couple of test failures). It also fixes a
couple of libunwind issues found when working on this (direct usage of
local memory space, error values not being negative and unw_word being
64bit != dwarf 64 format is always in use).
frysk-imports/libunwind/ChangeLog
2008-01-17 Mark Wielaard <mwielaard@redhat.com>
* include/dwarf.h (dwarf_extract_proc_info_from_fde): Pass
table_start.
* src/dwarf/Gfde.c (is_cie_id): Removed.
(parse_cie): Accept debug and eh cie ids.
(dwarf_extract_proc_info_from_fde): Accept table_start. Calculate
correct cie_addr. Fix error reporting.
* src/dwarf/Gfind_proc_info-lsb.c (linear_search): Don't depend
on local address space. Pass table start for fde parsing.
(dwarf_search_unwind_table): Handle debug_frame by linear search.
* src/mi/Gget_unwind_table.c (get_frame_table, get_debug_table):
new functions.
(unw_get_unwind_table): Call either get_frame_table or
get_debug_table depending on format.
frysk-sys/lib/unwind/ChangeLog
2008-01-17 Mark Wielaard <mwielaard@redhat.com>
* cni/UnwindH.hxx (get_eh_frame_hdr_addr): Find and return
debug_frame address and set pi->format.
(createProcInfoFromElfImage): Handle either debug_frame or
eh_frame addresses.
Tested on x86_64 and x86 (fedora and centos, which both have full
eh_frame coverage, so admittedly most of the new code paths aren't hit
yet).
Cheers,
Mark