From: Neil Horman <nhorman@lvl7.com>
To: Steffen Rumler <Steffen.Rumler@icn.siemens.de>
Cc: linuxppc <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: Accessing the user stack inside system call service routine
Date: Thu, 13 Jun 2002 07:10:13 -0400 [thread overview]
Message-ID: <3D087D95.5070206@lvl7.com> (raw)
In-Reply-To: 3D084D1F.95AFFCBB@icn.siemens.de
Since the process virtual address which are used on the user space stack are not
directly available from the context of the kernel, you will need to do some
virtual address translation to access teh stack frames you are interested in. I
would suggest that you look at the source code for the copy_to_user and
copy_from_user functions to see how they access a process address space from
kernel space. That will probably start you in the right direction.
hope that helps!
Neil :)
Steffen Rumler wrote:
> Hello,
>
> I want to access/record the user stack within the system call
> service routine sys_sigsuspend() (arch/ppc/signal.c),
> in order to debug hanging threads.
>
> The user register context is passed to sys_sigsuspend() via
> the 'struct pt_regs *regs' argument.
>
> In this way I can obtain the stack pointer r1
> (via regs->gpr[1]) and catch the PPC EABI stack frames.
>
> But I see all zeros behind 'regs->gpr[1]' instead of proper
> stack frames. What is wrong ?
>
> How can I access the user stack within a
> system call service routine (sys_XXX) ?
>
> Thank you for help,
>
>
> Steffen
>
> --
>
>
> --------------------------------------------------------------
>
> Steffen Rumler
> ICN ON PNE SB 4
> Siemens AG
> Hofmannstr. 51 Email: Steffen.Rumler@icn.siemens.de
> D-81359 Munich Phone: +49 89 722-44061
> Germany Fax : +49 89 722-36703
>
> --------------------------------------------------------------
>
>
--
/******************************************************************
*Neil Horman
*Software Engineer
*LVL7 Systems
*13000 Weston Pkwy.
*Cary, NC 27513
*(919)-865-2915
*nhorman@lvl7.com
*PGP keyID 0xB5E1020A
*http://www.keyserver.net/en
*******************************************************************/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-06-13 11:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-13 7:43 Accessing the user stack inside system call service routine Steffen Rumler
2002-06-13 11:10 ` Neil Horman [this message]
2002-06-13 14:20 ` Steffen Rumler
2002-06-13 15:11 ` Neil Horman
2002-06-13 21:46 ` Paul Mackerras
2002-06-13 22:28 ` Frank Rowand
2002-06-19 11:40 ` Steffen Rumler
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=3D087D95.5070206@lvl7.com \
--to=nhorman@lvl7.com \
--cc=Steffen.Rumler@icn.siemens.de \
--cc=linuxppc-embedded@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).