1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-09-27 08:59:28 +02:00
Commit graph

15 commits

Author SHA1 Message Date
Tommi Rantala
2aea391d6a ARM: invalidate proc info after non-dwarf unw_step()
After successfully stepping the cursor on ARM, the proc info is
invalidated only in dwarf_step(). Invalidate the proc info also when
stepping with the non-dwarf based methods. This fixes
unw_get_proc_info() returning stale data.

The core dump unwinder can be used for demonstrating the bug. When
unwinding based only on DWARF data, the proc info is correct:

$ UNW_ARM_UNWIND_METHOD=1 ./test-coredump-unwind core `cat backing_files` 2>/dev/null
    ip=0x000086d8 proc=000086d4-000086dc handler=0x00000000 lsda=0x00000000
    ip=0x000086ef proc=000086dc-000086f2 handler=0x00000000 lsda=0x00000000
    ip=0x000086e7 proc=000086dc-000086f2 handler=0x00000000 lsda=0x00000000
    ip=0x00008597 proc=00008584-0000859a handler=0x00000000 lsda=0x00000000
    ip=0x76e3ac3b proc=76e3aba0-76e3acec handler=0x00000000 lsda=0x00000000

When unwinding based only on the exidx method, we see the proc info
lagging behind:

$ UNW_ARM_UNWIND_METHOD=4 ./test-coredump-unwind core `cat backing_files` 2>/dev/null
    ip=0x000086d8 proc=000086d4-000086db handler=0x00000000 lsda=0x00000000
    ip=0x000086ef proc=000086d4-000086db handler=0x00000000 lsda=0x00000000
    ip=0x000086e7 proc=000086dc-000086f3 handler=0x00000000 lsda=0x00000000
    ip=0x00008597 proc=000086dc-000086f3 handler=0x00000000 lsda=0x00000000
    ip=0x76e3ac3b proc=00008584-0000859b handler=0x00000000 lsda=0x00000000
    ip=0x000085c3 proc=76e3aba0-76e3ae4b handler=0x00000000 lsda=0x00000000

Finally, with this patch applied, we get the desired proc info also with
the exidx unwinder:

$ UNW_ARM_UNWIND_METHOD=4 ./test-coredump-unwind core `cat backing_files` 2>/dev/null
    ip=0x000086d8 proc=000086d4-000086db handler=0x00000000 lsda=0x00000000
    ip=0x000086ef proc=000086dc-000086f3 handler=0x00000000 lsda=0x00000000
    ip=0x000086e7 proc=000086dc-000086f3 handler=0x00000000 lsda=0x00000000
    ip=0x00008597 proc=00008584-0000859b handler=0x00000000 lsda=0x00000000
    ip=0x76e3ac3b proc=76e3aba0-76e3ae4b handler=0x00000000 lsda=0x00000000
    ip=0x000085c3 proc=0000859c-00008613 handler=0x00000000 lsda=0x00000000
2012-09-04 14:58:38 +03:00
Tommi Rantala
5738bac171 ARM: fix with-signal-frame local unw_resume()
Make sure that the `sigcontext_addr' cursor member is pointing to the
`struct sigcontext' as expected in arm_local_resume().
2012-08-21 22:33:56 +03:00
Ken Werner
d84e5d5d24 Call dwarf_step only if CONFIG_DEBUG_FRAME is defined
The ARM EABI does not use the .eh_frame and .eh_frame_hdr sections for unwinding. Therefore it doesn't make sense to call dwarf_step if CONFIG_DEBUG_FRAME is not defined.
2011-11-19 15:37:23 -08:00
Ken Werner
912db91b05 ARM: Exit unw_step in case DWARF based unwinding was successful
Prevents unw_step from trying to unwind the stack using the ARM specific
unwind tables in case the DWARF based unwinding was successful.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-08-29 17:58:52 +02:00
Ken Werner
112c927371 ARM: Ensure unw_step returns whatever find_proc_info() returns
This allows the test-proc-info test case to pass on ARM.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-08-17 14:32:32 +00:00
Ken Werner
d83846f120 ARM: Initial support for remote unwinding using libunwind-ptrace
Change _UPTi_find_unwind_table to also look for the ARM specific unwind
information. Adjust the ARM unwind code to read memory using the accessor
routines.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-08-15 20:12:54 +02:00
Ken Werner
545023c207 Rework the lookup of the ARM specific unwind info
Implement routines for finding the proc_info and searching the unwind table
for the ARM backend.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-08-15 20:12:54 +02:00
Ken Werner
25f6b8295d Change address type from void* to unw_word_t.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-07-28 11:10:02 +00:00
Ken Werner
36511d3d1f Add support for handling signal frames on ARM Linux.
This patch add support for resuming at a certain stack frame even if signal
frames are involved. For restoring the registers the trampoline (sigreturn)
is used. RT and non-RT signal frames are handled for both >=2.6.18 and
<2.6.18 kernels.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-05-03 20:18:40 +02:00
Ken Werner
fd21d07fe4 Create a generic and local variant of the extbl parser.
In order to have the DWARF_* macros working properly a generic and a local
variant of the ex_tables.c have been created.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-04-05 20:59:10 -07:00
Ken Werner
dcb8d0d90f Prefer to unwind using DWARF info on ARM.
DWARF expressions are more powerful than the ARM specific unwind tables.
Therefore DWARF should be the preferred unwind method.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-24 20:44:33 -07:00
Ken Werner
cf8d5e41af Have the ARM extbtl-parser operate on the DWARF model directly.
This eliminates the arm_stackframe and therefore the need to synchronize the
two models. It also clears the way for unwinding call stacks with mixed
DWARF- and extbl-frames.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-24 20:42:00 -07:00
Zachary T Welch
6a67154674 Use ARM-specific unwinding tables in unw_step
Uses ex_tables routines to provide a new means of unwinding the stack.
Set UNW_ARM_UNWIND_METHOD=4 to use ARM-specific unwinding tables.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-22 08:14:58 -07:00
Arun Sharma
00aed9631b Add an experimental and optional frame chain unwinding for ARM
The environment variable UNW_ARM_UNWIND_METHOD controls the unwind method.

1 - debug_frame unwinding
2 - frame chain unwinding,
3 - 1 & 2 (default))

Signed-off-by: Andris Zeila <andris.zeila@accenture.com>
2010-05-26 19:28:44 -07:00
Daniel Jacobowitz
3842dac733 Add initial ARM and MIPS support. To support this, also enable the
reading of .debug_frame sections (used in lieu of .eh_frame sections
when they're not available).
2008-02-04 17:16:37 -07:00