Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Meador Inge <meadori@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/1] ARM: Fix crash when frame cannot be found
Date: Tue, 19 Jul 2011 19:05:00 -0000	[thread overview]
Message-ID: <1311101033-7648-1-git-send-email-meadori@codesourcery.com> (raw)

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(-)


             reply	other threads:[~2011-07-19 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 19:05 Meador Inge [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311101033-7648-1-git-send-email-meadori@codesourcery.com \
    --to=meadori@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox