Apply stub unwinder to 'bx reg' trampoline
authorYao Qi <yao@codesourcery.com>
Fri, 30 May 2014 08:06:32 +0000 (16:06 +0800)
committerYao Qi <yao@codesourcery.com>
Tue, 24 Jun 2014 01:30:29 +0000 (09:30 +0800)
commit18d18ac8105647241a4e24a3a4d0196955666e73
tree5e8424a3e22e8fad80e4c3caa488cffec8223aa8
parent80d8d3908b7ef70c325fcdfb455bf5dbc2c68e16
Apply stub unwinder to 'bx reg' trampoline

In target arm-none-eabi, prologue unwinder is used for trampoline
'bx reg'.  However, in target arm-linux, exidx unwinder is selected for
trampoline at first, which is not expected.  The main function and the
trampoline is,

   0x00009dfc <main+0>: push    {r4, r5, r6, r7, lr}
   ......
   0x0000ac30 <main+3636>:      ldrdeq  r3, [r1], -r8
   0x0000ac34:  bx      r2
   0x0000ac36:  bx      r4

and .ARM.exidx is:

0x9dfc <main>: @0xb404
  Compact model index: 1
  0x97      vsp = r7
  0x20      vsp = vsp + 132
  0x3f      vsp = vsp + 256
  0x80 0xf0 pop {r8, r9, r10, r11}
  0xab      pop {r4, r5, r6, r7, r14}

0xac38 <__aeabi_drsub>: 0x1 [cantunwind]

Trampolines 'bx r2' and 'bx r4' doesn't belong to main, but the exidx
for main is still selected form them because there is no end address
of each exidx entry.

Instead of teaching exidx unwinder ignore this trampoline (which looks
complicated and error prone), I decide to let stub unwinder to handle
trampoline, because stub undwinder is installed before exidx unwinder,
and this trampoline can be regarded as a stub too.

This patch is to add the code to match 'bx reg' trampoline in the
sniffer of stub unwinder.

gdb:

2014-06-24  Yao Qi  <yao@codesourcery.com>

* arm-tdep.c (arm_stub_unwind_sniffer): Return 1 if
arm_skip_bx_reg returns non-zero.
gdb/ChangeLog
gdb/arm-tdep.c
This page took 0.03941 seconds and 4 git commands to generate.