diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-03-30 16:44:24 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-03-30 16:44:24 +0100 |
commit | 779aa56f2c160ef508ca98fac1ffd23cad6fc63f (patch) | |
tree | 8f1236913f66c50f4f749181a9bef5606cf708bf /gdb/ChangeLog | |
parent | c58b006a7e886f55224901eb5a9d1d619e34c05f (diff) | |
download | gdb-779aa56f2c160ef508ca98fac1ffd23cad6fc63f.zip gdb-779aa56f2c160ef508ca98fac1ffd23cad6fc63f.tar.gz gdb-779aa56f2c160ef508ca98fac1ffd23cad6fc63f.tar.bz2 |
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.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index efd9da6..bb9b974 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 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. + +2016-03-30 Yao Qi <yao.qi@linaro.org> + * arm-tdep.c (arm_stack_frame_destroyed_p): Rename it ... (arm_stack_frame_destroyed_p_1): ... here. Don't call arm_pc_is_thumb. |