The thumb-prologue.exp test has a hard-coded breakpoint.
Unfortunately different ARM environments require different
breakpoints; for instance, Linux and bare metal use different ones,
and SymbianOS required something different yet again. So I reworked
the test to make GDB set the breakpoint. The method used to find the
right location is a little convoluted, but reliable - see the comment.
/* Normally Thumb functions use r7 as the frame pointer. However,
- with the GCC option -mtpcs-frame, they may use fp instead. */
+ with the GCC option -mtpcs-frame, they may use fp instead. Make
+ sure that the prologue analyzer can handle this. */
- /* Trap. */
- " .short 0xdffe\n"
+ /* We'll set a breakpoint at this call. We can't hardcode a trap
+ instruction; the right instruction to use varies too much. And
+ we can't use a global label, because GDB will think that's the
+ start of a new function. So, this slightly convoluted
+ technique. */
+ " nop\n"