Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb@sourceware.org
Subject: Re: [RFC] Using values to handle unwinding
Date: Wed, 17 Oct 2007 22:09:00 -0000	[thread overview]
Message-ID: <20071017220943.GA24607@caradoc.them.org> (raw)
In-Reply-To: <20071017160350.GA26804@caradoc.them.org>

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.

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!

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-10-17 22:09 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 [this message]
2007-10-19 11:42   ` Ulrich Weigand
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=20071017220943.GA24607@caradoc.them.org \
    --to=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