Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <Michael.Snyder@palmsource.com>
To: GDB Patches ML <gdb-patches@sourceware.org>,
		Daniel Jacobowitz <drow@false.org>
Subject: Infinite backtrace on (eg.) ARM
Date: Fri, 22 Sep 2006 01:48:00 -0000	[thread overview]
Message-ID: <1158889724.22863.41.camel@localhost.localdomain> (raw)

Been thinking about this problem.  Check me out here.

Taking a step or two back from the intimate view of gdb internals, 
the problem (if I understand it) is detecting the fact that we have
an unusual case of a function that doesn't save it's return address.
We have to detect the fact that we should stop the frame chain at
this function's frame.

So the most common case of a function that doesn't save its return
address is a leaf function, yes?  But we can distinguish that case
from the pathological case by looking at the frame->level.  A leaf
function can only be at frame level zero, unles we've made a dummy
frame on top of it via a target function call.

So we can check for:
  * doesn't save its PC, and
  * frame->level > 0, and
  * frame->next is not a call dummy.

Except that the information "doesn't save its PC" isn't public
at the point where we want it.  It's hidden within frame_register_unwind
and below -- in this case, in trad_frame.  So we sort of have a problem
of "what do we know, and when do we know it".

So -- what if we exported a method to make that info public?
It's rather specific, but in this case important: "does this
frame save its return address?"



             reply	other threads:[~2006-09-22  1:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22  1:48 Michael Snyder [this message]
2006-09-22  2:59 ` Daniel Jacobowitz
2006-09-22 18:56   ` Michael Snyder
2006-10-05 21:51     ` Ping, " Michael Snyder
2006-10-05 22:27       ` Daniel Jacobowitz
2006-09-22 19:00 ` Jim Blandy

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=1158889724.22863.41.camel@localhost.localdomain \
    --to=michael.snyder@palmsource.com \
    --cc=drow@false.org \
    --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