linux-mips
[Top] [All Lists]

Re: HELP : ptrace returns puzzling results

To: Jun Sun <jsun@mvista.com>
Subject: Re: HELP : ptrace returns puzzling results
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Tue, 16 May 2000 13:36:20 +0200
Cc: linux@cthulhu.engr.sgi.com, linux-mips@fnet.fr, linux-mips@vger.rutgers.edu
In-reply-to: <392045FC.827CACB5@mvista.com>; from jsun@mvista.com on Mon, May 15, 2000 at 11:46:20AM -0700
References: <392045FC.827CACB5@mvista.com>
Sender: owner-linuxmips@oss.sgi.com
On Mon, May 15, 2000 at 11:46:20AM -0700, Jun Sun wrote:

> I am writing a gdbserver for linux/mips.  The server can now talk with
> the gdb client, and can run to completion if you press 'c'.

Excellent.

> However, the gdb client reads some confusing register values.  I traced
> back to the gdbserver and found out that these values are returned from
> ptrace(), which seem wrong.  On the other hand, the native gdb must be
> using the same ptrace() to get register values.  I wonder why it works
> there.
> 
> Here is a sample output from gdbserver calling ptrace.  Note that PC
> value does not corresponds to the executable image.  sp also seems
> wrong.

> reg #29 ($29,sp) = 2147483120 (0x7ffffdf0)

The value of sp looks sane, it a value near the absolute top of the stack
at 0x80000000.

> reg #37 ($64,pc) = 263607008 (0x0fb652e0)

Also looks sane at first look, this value is in the typical address range
where the dynamic linker gets mapped.

Many of the registers in the dump you gave have a value of zero and that is
worrying me much more.  All the caller saved registers are zero, that
smells.

What kernel version are you using?

  Ralf

<Prev in Thread] Current Thread [Next in Thread>