Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/1] ARM: Fix crash when frame cannot be found
@ 2011-07-19 19:05 Meador Inge
  2011-07-19 19:11 ` [PATCH 1/1] ARM: Change prologue analyzer to always fallback on SP Meador Inge
  0 siblings, 1 reply; 5+ messages in thread
From: Meador Inge @ 2011-07-19 19:05 UTC (permalink / raw)
  To: gdb-patches

This patch addresses an issue with the ARM prologue analyzer that occurs
when the frame pointer cannot be deduced.  The way things are currently
written GDB crashes in some cases.

For example, a crash can occur when the first instruction in the assembly
function in question is 'mov sp, r0'.  When stepping GDB kicks off a prologue
analysis from 'arm-tdep.c:arm_make_prologue_cache'.  However, it can't actually
find the frame, so it sets the cached frame reg to -1.  Later on in
'arm_make_prologue_cache' GDB tries to pass 'cache->framereg' to
'get_frame_register_unsigned' and crashes.

This patch fixes the problem by always falling back on the SP register when
the frame cannot be computed.  A similar strategy is used on other
architectures.  GDB testsuite run with 'target sim'; no regressions.  Some
ad hoc testing done on actual hardware as well.

OK?

Meador Inge (1):
  arm: Change prologue analyzer to always fallback on SP.

 gdb/arm-tdep.c                            |   16 +------------
 gdb/testsuite/gdb.arch/thumb-prologue.c   |   34 +++++++++++++++++++++++++++++
 gdb/testsuite/gdb.arch/thumb-prologue.exp |   27 +++++++++++++++++++++++
 3 files changed, 63 insertions(+), 14 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-09  0:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-19 19:05 [PATCH 0/1] ARM: Fix crash when frame cannot be found Meador Inge
2011-07-19 19:11 ` [PATCH 1/1] ARM: Change prologue analyzer to always fallback on SP Meador Inge
2011-07-19 21:04   ` Daniel Jacobowitz
2011-10-25  2:19     ` Meador Inge
2011-11-09  0:54       ` Meador Inge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox