Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb@sourceware.org
Subject: Re: [RFC] Using values to handle unwinding
Date: Fri, 19 Oct 2007 11:42:00 -0000	[thread overview]
Message-ID: <200710191141.l9JBfok4014965@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20071017220943.GA24607@caradoc.them.org> from "Daniel Jacobowitz" at Oct 17, 2007 06:09:43 PM

Daniel Jacobowitz wrote:

> There is one current use I know of for the NEXT_FRAME argument to
> unwinders, in s390-tdep.c:
> 
>       /* If the next frame is a NORMAL_FRAME, this frame *cannot* have frame
>          size zero.  This is only possible if the next frame is a sentinel
>          frame, a dummy frame, or a signal trampoline frame.  */
>       /* FIXME: cagney/2004-05-01: This sanity check shouldn't be
>          needed, instead the code should simpliy rely on its
>          analysis.  */
>       if (get_frame_type (next_frame) == NORMAL_FRAME)
>         return 0;
> 
> Maybe this means we should either find a generic place to do this sort
> of check, or pass both this and next frame, or leave the frame
> argument alone after all.  Or add a new frame function, like
> "frame_called_normally (this_frame)" which seems to be the question
> people are really asking when they write code like the above.

Well, we can always just use "get_next_frame (this_frame)" instead
of next_frame.   Getting the next frame is always well-defined.
So I don't think this influences the this_frame vs. next_frame
discussion one way or the other ...

> I noticed this while looking at m68k-elf backtraces.  It would be nice
> to add a check like the above, either there or somewhere more generic,
> because otherwise a garbage stack pointer leads to a near-infinite
> backtrace.  Any time that the current frame's PC points to somewhere
> GDB has no symbol info, GDB will conclude that there is a frameless
> function which only stored its return address on the stack at the
> call.  So each word of the stack is popped in turn and becomes a new
> PC.  Not very useful!

Yes, situations similar to that were what prompted my addition of the
above sanity check (Andrew's comment nonwithstanding :-/).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2007-10-19 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-17 16:04 Daniel Jacobowitz
2007-10-17 22:09 ` Daniel Jacobowitz
2007-10-19 11:42   ` Ulrich Weigand [this message]
2007-10-19 11:49     ` Daniel Jacobowitz
2007-10-19  4:30 ` Joel Brobecker
2007-10-19 11:43   ` Daniel Jacobowitz
2007-10-19 12:10 ` Ulrich Weigand
2007-10-19 12:40   ` Daniel Jacobowitz
2008-03-31 23:41 ` Daniel Jacobowitz
2008-04-04 17:53   ` Joel Brobecker
2008-04-05 15:56     ` Daniel Jacobowitz

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=200710191141.l9JBfok4014965@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb@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