Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: gdb-patches@sourceware.org, Nigel Stephens <nigel@mips.com>,
		"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: Do not unwind frames past NULL PC
Date: Fri, 22 Feb 2008 18:31:00 -0000	[thread overview]
Message-ID: <20080222172056.GA1693@caradoc.them.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0802221457040.21569@perivale.mips.com>

On Fri, Feb 22, 2008 at 05:12:18PM +0000, Maciej W. Rozycki wrote:
> Hello,
> 
>  Some architectures, like MIPS, specify in the ABI that the value of the 
> return address in a frame (or in other words the value of the PC the frame 
> would have been called from) being zero denotes the outermost frame.  At 
> the moment GDB does not seem to have a way to terminate frame unwinding in 
> an architecture-specific way (or to that matter any that would not imply 
> an error condition) in get_prev_frame_1(), which is where such a check 
> would be needed.
> 
>  However even for these architectures which may not necessarily specify in 
> the relevant ABI that a NULL PC is the terminating value it seems rather 
> unlikely for a function to have been called in a way which would make its 
> return address to be zero and yet it having a genuine caller with an 
> associated frame.  Therefore I propose the following check to be 
> introduced to get_prev_frame_1().  It removes the confusing bogus frame at 
> the bottom of a backtrace like below:

Similar changes have been proposed several times, but were controversial.

  http://sourceware.org/ml/gdb-patches/2006-05/msg00196.html
  http://sourceware.org/ml/gdb-patches/2006-07/msg00296.html

and more recently:

  http://sourceware.org/ml/gdb-patches/2007-12/msg00004.html

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-02-22 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 17:21 Maciej W. Rozycki
2008-02-22 18:31 ` Daniel Jacobowitz [this message]
2008-02-22 19:50   ` Maciej W. Rozycki
2008-02-25 19:19     ` Maciej W. Rozycki

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=20080222172056.GA1693@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.org \
    --cc=macro@mips.com \
    --cc=nigel@mips.com \
    /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