public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* No PTRACE_READDATA for archs other than SPARC?
@ 2002-05-20  3:08 Pradeep Padala
  2002-05-20  4:40 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Pradeep Padala @ 2002-05-20  3:08 UTC (permalink / raw)
  To: linux-kernel

Hi,
   I was trying to understand ptrace code in kernel. It seems there's
no PTRACE_READDATA for architectures other than sparc and sparc64.
There's a function named ptrace_readdata() in kernel/ptrace.c but I
couldn't find a way to invoke it from user space. Is the feature
missing? or Is it intended?
   Another thing I noticed, the prototype for do_ptrace() in
   arch/sparc/kernel/ptrace.c is

   asmlinkage void do_ptrace(struct pt_regs *regs)

   I thought it should be some thing like
   asmlinkage int sys_ptrace(long request, long pid, long addr, long
data)

   It would be great if some one can answer it.

Thank You,
Pradeep Padala

-- 
Perfection is our goal, excellence will be tolerated. -- J. Yahl
--



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20  3:08 No PTRACE_READDATA for archs other than SPARC? Pradeep Padala
@ 2002-05-20  4:40 ` David S. Miller
  2002-05-20  6:29   ` Frank Schaefer
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: David S. Miller @ 2002-05-20  4:40 UTC (permalink / raw)
  To: ppadala; +Cc: linux-kernel

   From: Pradeep Padala <ppadala@cise.ufl.edu>
   Date: Sun, 19 May 2002 23:08:36 -0400 (EDT)

      I was trying to understand ptrace code in kernel. It seems there's
   no PTRACE_READDATA for architectures other than sparc and sparc64.
   There's a function named ptrace_readdata() in kernel/ptrace.c but I
   couldn't find a way to invoke it from user space. Is the feature
   missing? or Is it intended?

Only Sparc implements this, that is correct.

If other platforms added PTRACE_READDATA support, they would
also need to add some way to do a feature test for it's presence
so that GDB and other debugging code could actually make use
of it portably.

      Another thing I noticed, the prototype for do_ptrace() in
      arch/sparc/kernel/ptrace.c is
   
      asmlinkage void do_ptrace(struct pt_regs *regs)
   
      I thought it should be some thing like
      asmlinkage int sys_ptrace(long request, long pid, long addr, long
   data)

The return values are set directly in the user's pt_regs.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20  4:40 ` David S. Miller
@ 2002-05-20  6:29   ` Frank Schaefer
  2002-05-20 21:18     ` David S. Miller
  2002-05-20 20:12   ` Pradeep Padala
  2002-05-29 23:49   ` Daniel Jacobowitz
  2 siblings, 1 reply; 13+ messages in thread
From: Frank Schaefer @ 2002-05-20  6:29 UTC (permalink / raw)
  To: linux-kernel

On Mon, 2002-05-20 at 06:40, David S. Miller wrote:
>    From: Pradeep Padala <ppadala@cise.ufl.edu>
>    Date: Sun, 19 May 2002 23:08:36 -0400 (EDT)
> 
>       I was trying to understand ptrace code in kernel. It seems there's
>    no PTRACE_READDATA for architectures other than sparc and sparc64.
>    There's a function named ptrace_readdata() in kernel/ptrace.c but I
>    couldn't find a way to invoke it from user space. Is the feature
>    missing? or Is it intended?
> 
> Only Sparc implements this, that is correct.

... and that's the reason why GDB don't support follow-fork-mode for the
intel pltform - right? ( I had a related thread on the gdb mailing list
not soo long ago. )

Frank



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20  4:40 ` David S. Miller
  2002-05-20  6:29   ` Frank Schaefer
@ 2002-05-20 20:12   ` Pradeep Padala
  2002-05-29 23:49   ` Daniel Jacobowitz
  2 siblings, 0 replies; 13+ messages in thread
From: Pradeep Padala @ 2002-05-20 20:12 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

> Only Sparc implements this, that is correct.
> 
> If other platforms added PTRACE_READDATA support, they would
> also need to add some way to do a feature test for it's presence
> so that GDB and other debugging code could actually make use
> of it portably.

You mean, it's an undocumented feature for sparc?

If I want to add it to i386, what do I need to add so that
gdb/debuggers know that the feature exists.


> The return values are set directly in the user's pt_regs.

I get it. Thanx for the info

--pradeep


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20  6:29   ` Frank Schaefer
@ 2002-05-20 21:18     ` David S. Miller
  2002-05-29 23:51       ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: David S. Miller @ 2002-05-20 21:18 UTC (permalink / raw)
  To: frank.schafer; +Cc: linux-kernel

   From: Frank Schaefer <frank.schafer@setuza.cz>
   Date: 20 May 2002 08:29:50 +0200

   On Mon, 2002-05-20 at 06:40, David S. Miller wrote:
   > Only Sparc implements this, that is correct.
   
   ... and that's the reason why GDB don't support follow-fork-mode for the
   intel pltform - right? ( I had a related thread on the gdb mailing list
   not soo long ago. )

I can't see any reason why lack of PTRACE_READDATA prevents follow
fork mode support in GDB.  But then again the GDB maintainers are a
bunch of pinheads so...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20  4:40 ` David S. Miller
  2002-05-20  6:29   ` Frank Schaefer
  2002-05-20 20:12   ` Pradeep Padala
@ 2002-05-29 23:49   ` Daniel Jacobowitz
  2002-05-30  0:31     ` David S. Miller
  2002-06-04  4:37     ` David S. Miller
  2 siblings, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2002-05-29 23:49 UTC (permalink / raw)
  To: David S. Miller; +Cc: ppadala, linux-kernel

On Sun, May 19, 2002 at 09:40:53PM -0700, David S. Miller wrote:
>    From: Pradeep Padala <ppadala@cise.ufl.edu>
>    Date: Sun, 19 May 2002 23:08:36 -0400 (EDT)
> 
>       I was trying to understand ptrace code in kernel. It seems there's
>    no PTRACE_READDATA for architectures other than sparc and sparc64.
>    There's a function named ptrace_readdata() in kernel/ptrace.c but I
>    couldn't find a way to invoke it from user space. Is the feature
>    missing? or Is it intended?
> 
> Only Sparc implements this, that is correct.
> 
> If other platforms added PTRACE_READDATA support, they would
> also need to add some way to do a feature test for it's presence
> so that GDB and other debugging code could actually make use
> of it portably.

Not really, we should just get EINVAL (ENOSYS?) back when we try to use
it, right?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-20 21:18     ` David S. Miller
@ 2002-05-29 23:51       ` Daniel Jacobowitz
  2002-05-30  0:03         ` William Lee Irwin III
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2002-05-29 23:51 UTC (permalink / raw)
  To: David S. Miller; +Cc: frank.schafer, linux-kernel

On Mon, May 20, 2002 at 02:18:00PM -0700, David S. Miller wrote:
>    From: Frank Schaefer <frank.schafer@setuza.cz>
>    Date: 20 May 2002 08:29:50 +0200
> 
>    On Mon, 2002-05-20 at 06:40, David S. Miller wrote:
>    > Only Sparc implements this, that is correct.
>    
>    ... and that's the reason why GDB don't support follow-fork-mode for the
>    intel pltform - right? ( I had a related thread on the gdb mailing list
>    not soo long ago. )
> 
> I can't see any reason why lack of PTRACE_READDATA prevents follow
> fork mode support in GDB.

It doesn't.  Follow-fork support is possible now, with a speed hit, but
I am waiting for better kernel support; it should be forthcoming with
the task ornament-based debugging interface proposed some time ago.

>  But then again the GDB maintainers are a
> bunch of pinheads so...

Hey, I resemble this remark.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-29 23:51       ` Daniel Jacobowitz
@ 2002-05-30  0:03         ` William Lee Irwin III
  2002-05-30  0:15           ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: William Lee Irwin III @ 2002-05-30  0:03 UTC (permalink / raw)
  To: David S. Miller, frank.schafer, linux-kernel

On Mon, May 20, 2002 at 02:18:00PM -0700, David S. Miller wrote:
>> I can't see any reason why lack of PTRACE_READDATA prevents follow
>> fork mode support in GDB.

On Wed, May 29, 2002 at 07:51:16PM -0400, Daniel Jacobowitz wrote:
> It doesn't.  Follow-fork support is possible now, with a speed hit, but
> I am waiting for better kernel support; it should be forthcoming with
> the task ornament-based debugging interface proposed some time ago.

What is this and who is working on it?


Cheers,
Bill

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-30  0:03         ` William Lee Irwin III
@ 2002-05-30  0:15           ` Daniel Jacobowitz
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2002-05-30  0:15 UTC (permalink / raw)
  To: William Lee Irwin III, David S. Miller, frank.schafer,
	linux-kernel

On Wed, May 29, 2002 at 05:03:11PM -0700, William Lee Irwin III wrote:
> On Mon, May 20, 2002 at 02:18:00PM -0700, David S. Miller wrote:
> >> I can't see any reason why lack of PTRACE_READDATA prevents follow
> >> fork mode support in GDB.
> 
> On Wed, May 29, 2002 at 07:51:16PM -0400, Daniel Jacobowitz wrote:
> > It doesn't.  Follow-fork support is possible now, with a speed hit, but
> > I am waiting for better kernel support; it should be forthcoming with
> > the task ornament-based debugging interface proposed some time ago.
> 
> What is this and who is working on it?

David Howells, at the same time as the rest of the task ornaments
stuff.  You'd have to ask him what the current state of it is.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-29 23:49   ` Daniel Jacobowitz
@ 2002-05-30  0:31     ` David S. Miller
  2002-05-30  0:48       ` Daniel Jacobowitz
  2002-06-04  4:37     ` David S. Miller
  1 sibling, 1 reply; 13+ messages in thread
From: David S. Miller @ 2002-05-30  0:31 UTC (permalink / raw)
  To: dmj+; +Cc: ppadala, linux-kernel

   From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
   Date: Wed, 29 May 2002 19:49:51 -0400

   On Sun, May 19, 2002 at 09:40:53PM -0700, David S. Miller wrote:
   > If other platforms added PTRACE_READDATA support, they would
   > also need to add some way to do a feature test for it's presence
   > so that GDB and other debugging code could actually make use
   > of it portably.
   
   Not really, we should just get EINVAL (ENOSYS?) back when we try to use
   it, right?

You'd get -EIO, but otherwise yes you are right.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-30  0:31     ` David S. Miller
@ 2002-05-30  0:48       ` Daniel Jacobowitz
  2002-05-30 15:22         ` Pradeep Padala
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2002-05-30  0:48 UTC (permalink / raw)
  To: David S. Miller; +Cc: ppadala, linux-kernel

On Wed, May 29, 2002 at 05:31:18PM -0700, David S. Miller wrote:
>    From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
>    Date: Wed, 29 May 2002 19:49:51 -0400
> 
>    On Sun, May 19, 2002 at 09:40:53PM -0700, David S. Miller wrote:
>    > If other platforms added PTRACE_READDATA support, they would
>    > also need to add some way to do a feature test for it's presence
>    > so that GDB and other debugging code could actually make use
>    > of it portably.
>    
>    Not really, we should just get EINVAL (ENOSYS?) back when we try to use
>    it, right?
> 
> You'd get -EIO, but otherwise yes you are right.

Really?  That's inconvenient; the same result as for an invalid memory
address.

Oh well, it can still be worked around in GDB.  I'd like to see this on
more/all architectures.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-30  0:48       ` Daniel Jacobowitz
@ 2002-05-30 15:22         ` Pradeep Padala
  0 siblings, 0 replies; 13+ messages in thread
From: Pradeep Padala @ 2002-05-30 15:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: David S. Miller, linux-kernel

> Oh well, it can still be worked around in GDB.  I'd like to see this on
> more/all architectures.

I will try to get the feature for i386 architecture. I will let you
know when I amd done.

--pradeep


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: No PTRACE_READDATA for archs other than SPARC?
  2002-05-29 23:49   ` Daniel Jacobowitz
  2002-05-30  0:31     ` David S. Miller
@ 2002-06-04  4:37     ` David S. Miller
  1 sibling, 0 replies; 13+ messages in thread
From: David S. Miller @ 2002-06-04  4:37 UTC (permalink / raw)
  To: dmj+; +Cc: ppadala, linux-kernel

   From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
   Date: Wed, 29 May 2002 19:49:51 -0400
   
   Not really, we should just get EINVAL (ENOSYS?) back when we try to use
   it, right?
   
I answered this last week, you will get -EIO which turns out to also a
valid return from PTRACE_READDATA.  So a backwards compatible way to
test for existence of PTRACE_READDATA is going to be difficult.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-06-04  5:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-20  3:08 No PTRACE_READDATA for archs other than SPARC? Pradeep Padala
2002-05-20  4:40 ` David S. Miller
2002-05-20  6:29   ` Frank Schaefer
2002-05-20 21:18     ` David S. Miller
2002-05-29 23:51       ` Daniel Jacobowitz
2002-05-30  0:03         ` William Lee Irwin III
2002-05-30  0:15           ` Daniel Jacobowitz
2002-05-20 20:12   ` Pradeep Padala
2002-05-29 23:49   ` Daniel Jacobowitz
2002-05-30  0:31     ` David S. Miller
2002-05-30  0:48       ` Daniel Jacobowitz
2002-05-30 15:22         ` Pradeep Padala
2002-06-04  4:37     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox