1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-28 12:11:45 +02:00
libunwind-eh_elf/src/arm
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
..
Gcreate_addr_space.c Fix memory leaks in unw_create_addr_space() wrong-endian error paths 2012-08-21 22:33:29 +03:00
gen-offsets.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
getcontext.S Add an experimental and optional frame chain unwinding for ARM 2010-05-26 19:28:44 -07:00
Gex_tables.c ARM: fix unwind table search when IP less than first table entry 2012-02-01 07:57:15 -08:00
Gget_proc_info.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gget_save_loc.c Fix incorrect calls to memset. 2011-10-02 22:43:28 -07:00
Gglobal.c ARM: implement dwarf_to_unw_regnum() macro without table 2012-08-21 22:30:46 +03:00
Ginit.c [ARM] Add support for systems that don't support ucontext.h 2011-10-29 17:12:43 -07:00
Ginit_local.c [ARM] Add support for systems that don't support ucontext.h 2011-10-29 17:12:43 -07:00
Ginit_remote.c During the stack unwinding process, the return address points to 2010-04-24 19:16:09 -07:00
Gis_signal_frame.c Fix breakage when host != target 2011-11-03 08:24:18 -07:00
Gregs.c ARM: Return the dwarf.cfa in case the user requests SP/R13. 2011-03-24 20:44:33 -07:00
Gresume.c ARM: fix non-signal-frame local unw_resume() due to compiler optimization cleverness 2012-08-21 22:33:56 +03:00
Gstep.c ARM: invalidate proc info after non-dwarf unw_step() 2012-09-04 14:58:38 +03:00
init.h [ARM] Add support for systems that don't support ucontext.h 2011-10-29 17:12:43 -07:00
is_fpreg.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lcreate_addr_space.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lex_tables.c Create a generic and local variant of the extbl parser. 2011-04-05 20:59:10 -07:00
Lget_proc_info.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lget_save_loc.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lglobal.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit_local.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit_remote.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lis_signal_frame.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lregs.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lresume.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lstep.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
offsets.h Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
regname.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
siglongjmp.S Add an experimental and optional frame chain unwinding for ARM 2010-05-26 19:28:44 -07:00
unwind_i.h Add initial support for local unw_resume on ARM Linux. 2011-04-21 17:25:42 +02:00