public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kaih@khms.westfalen.de (Kai Henningsen)
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] generic show_stack facility
Date: 30 Mar 2002 12:06:00 +0200	[thread overview]
Message-ID: <8LrTyWC1w-B@khms.westfalen.de> (raw)
In-Reply-To: <15524.45472.231096.377756@napali.hpl.hp.com>

davidm@napali.hpl.hp.com (David Mosberger)  wrote on 29.03.02 in <15524.45472.231096.377756@napali.hpl.hp.com>:

> As far as I know, the x86 version of show_trace() still relies on the
> fact that (a) return addresses are stored on the memory stack, (b)
> they are stored in the order in which the routines were called, and
> (c) that there aren't too many other values on the stack that look
> like kernel text addresses.  As long as an x86 compiler uses the CALL
> instruction, that should be the case.

(b) is certainly not necessarily true for architectures like PPC, but the  
rest seems fairly unobjectionable - assuming that you first flush out your  
registers so any addresses only in registers get put on the stack, too. At  
least outside of Forth, separate return stacks seem to be extremely rare.

And as for the possibility of using several registers for return addresses  
such that dumping them leaves them on the stack out of order, well, the  
only thing I can see to get the original order back is to consult debug  
information that says where, on every call, to look for the next-up return  
address. Which doesn't seem quite feasible with anything less than a full  
gdb to do it.

What I don't see is what connection this can possibly have to the  
prototype of a stack dump routine.

MfG Kai

  reply	other threads:[~2002-03-30 12:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-29 15:23 [PATCH] generic show_stack facility Christoph Hellwig
2002-03-29 15:46 ` David Mosberger
2002-03-29 16:06   ` Christoph Hellwig
2002-03-29 17:08     ` David Mosberger
2002-03-29 17:16       ` arjan
2002-03-29 18:25         ` David Mosberger
2002-03-30 10:06           ` Kai Henningsen [this message]
2002-03-29 17:36       ` Andrew Morton
2002-03-29 18:26         ` David Mosberger
2002-03-29 18:34         ` Christoph Hellwig
2002-03-29 18:41           ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2002-03-30  3:05 Keith Owens
2002-03-30  3:31 ` Andrew Morton

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=8LrTyWC1w-B@khms.westfalen.de \
    --to=kaih@khms.westfalen.de \
    --cc=linux-kernel@vger.kernel.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