public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: strace not working with latest git
Date: Fri, 12 Sep 2008 09:35:14 +0000	[thread overview]
Message-ID: <20080912093514.GA10594@linux-sh.org> (raw)
In-Reply-To: <37C9A1F7C45F1F498E9CB8295E7B305C513CBB@em-srv1-kaha.intern.emtrion.de>

On Thu, Sep 11, 2008 at 04:00:16PM +0200, Nylund, Martin wrote:
> 
> > I haven't bee able to get strace working on my sh7722 target:
> > 
> > $> uname -a
> > Linux 192.168.105.52 2.6.27-rc6-00008-g3ed6d13-dirty #184 Wed 
> > Sep 10 17:31:44 CEST 2008 sh4al-dsp unknown
> > 
> > $> strace ls
> > restart_syscall(<... resuming interrupted call ...>) = 0
> > .
> > . <repeating many times>
> > .
> > restart_syscall(<... resuming interrupted call ...>) = 0 
> > restart_syscall(<... resuming interrupted call ...>) = 0
> > bin      etc      linuxrc  mplayer  sbin     tmp
> > restart_syscall(<... resuming interrupted call ...>) = 0
> > boot     include  man      opt      share    usr
> > restart_syscall(<... resuming interrupted call ...>) = 0
> > dev      lib      mnt      proc     sys      var
> > restart_syscall(<... resuming interrupted call ...>) = 0
> > ~ #                            
> > 
> > 
> > I traced the problem a bit and in strace sources, the ptrace 
> > call PTRACE_PEEKUSR always returns 0 when fetching the 
> > syscall number. I also added a printk to PTRACE_PEEKUSR in 
> > arch/sh/kernel/ptrace_32.c and the returned value is always 0. 
> > 
> 
> I got strace now working with following hack. Still don't know why this
> is needed though. get_stack_long() seemst to read data from wrong
> offset...
> 
> diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
> index 035cb30..950b7e2 100644
> --- a/arch/sh/kernel/ptrace_32.c
> +++ b/arch/sh/kernel/ptrace_32.c
> @@ -107,6 +107,9 @@ long arch_ptrace(struct task_struct *child, long
> request, long addr, long data)
>         struct user * dummy = NULL;
>         int ret;
> 
> +       if(addr<0xff)
> +           addr=(addr+0x34);
> +
>         switch (request) {
>         /* read the word at location addr in the USER area. */
>         case PTRACE_PEEKUSR: {
> 
This looks very much like the sizeof struct pt_dspregs. What is your
CONFIG_SH_DSP setting? Have you tried changing it and comparing?

  parent reply	other threads:[~2008-09-12  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10 15:52 strace not working with latest git Nylund, Martin
2008-09-11  9:43 ` AW: " Nylund, Martin
2008-09-11 14:00 ` Nylund, Martin
2008-09-12  9:35 ` Paul Mundt [this message]
2008-09-12  9:54 ` Nylund, Martin
2008-09-12 10:39 ` Paul Mundt

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=20080912093514.GA10594@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@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