This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add arm epilogue unwinder
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 30 Mar 2016 12:01:55 -0400
- Subject: [binutils-gdb] Add arm epilogue unwinder
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 779aa56f2c160ef508ca98fac1ffd23cad6fc63f ***
Author: Yao Qi <yao.qi@linaro.org>
Branch: master
Commit: 779aa56f2c160ef508ca98fac1ffd23cad6fc63f
Add arm epilogue unwinder
Nowadays, GDB can't unwind successfully from epilogue on arm,
(gdb) bt
#0 0x76ff65a2 in shr1 () from /home/yao/Source/gnu/build/gdb/testsuite/gdb.reverse/shr1.sl
#1 0x0000869e in main () at /home/yao/Source/gnu/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.reverse/solib-reverse.c:34
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) disassemble shr1
Dump of assembler code for function shr1:
....
0x76ff659a <+10>: adds r7, #12
0x76ff659c <+12>: mov sp, r7
0x76ff659e <+14>: ldr.w r7, [sp], #4
0x76ff65a2 <+18>: bx lr
End of assembler dump.
in this case, prologue unwinder is used. It analyzes the prologue and
get the offsets of saved registers to SP. However, in epilogue, the
SP has been restored, prologue unwinder gets the registers from the
wrong address, and even the frame id is wrong.
In reverse debugging, this case (program stops at the last instruction
of function) happens quite frequently due to the reverse execution.
There are many test fails due to missing epilogue unwinder.
This adds epilogue unwinder, but the frame cache is still get by
prologue unwinder except that SP is fixed up separately, because SP
is restored in epilogue.
This patch fixes many fails in solib-precsave.exp, and solib-reverse.exp.
gdb:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c: (arm_make_epilogue_frame_cache): New function.
(arm_epilogue_frame_this_id): New function.
(arm_epilogue_frame_prev_register): New function.
(arm_epilogue_frame_sniffer): New function.
(arm_epilogue_frame_unwind): New.
(arm_gdbarch_init): Append unwinder arm_epilogue_frame_unwind.
- Follow-Ups:
- Failures on RHEL-s390x-m64, branch master *** BREAKAGE ***
- Failures on AIX-POWER7-plain, branch master
- Failures on Fedora-s390x-m64, branch master *** BREAKAGE ***
- Failures on Debian-i686, branch master *** BREAKAGE ***
- Failures on Debian-i686-native-extended-gdbserver, branch master *** BREAKAGE ***
- Failures on Debian-x86_64-native-extended-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Debian-x86_64-m64, branch master *** BREAKAGE ***
- Failures on Debian-s390x-native-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Debian-s390x-m64, branch master *** BREAKAGE ***
- Failures on Fedora-i686, branch master *** BREAKAGE ***
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-m32, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-cc-with-index, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-cxx-build-m64, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-m64, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64be-cc-with-index, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64be-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64be-native-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64le-cc-with-index, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64le-native-extended-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64le-native-gdbserver-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64le-m64, branch master *** BREAKAGE ***