* [PATCH] ptrace(2): note SPARC deviation wrt get/set regs @ 2009-10-25 7:15 Mike Frysinger [not found] ` <1256454909-22861-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Mike Frysinger @ 2009-10-25 7:15 UTC (permalink / raw) To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA Unfortunately the SPARC ptrace port handles the addr/data args the opposite of every other arch. It expects the struct to be in addr and the data is ignored. Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> --- man2/ptrace.2 | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/man2/ptrace.2 b/man2/ptrace.2 index 68601df..7cce955 100644 --- a/man2/ptrace.2 +++ b/man2/ptrace.2 @@ -168,6 +168,8 @@ respectively, to location \fIdata\fP in the parent. See \fI<sys/user.h>\fP for information on the format of this data. (\fIaddr\fP is ignored.) + +Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP reversed. .TP .BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)" Retrieve information about the signal that caused the stop. @@ -184,6 +186,8 @@ As for some general purpose register modifications may be disallowed. (\fIaddr\fP is ignored.) + +Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP reversed. .TP .BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)" Set signal information. -- 1.6.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1256454909-22861-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] ptrace(2): note SPARC deviation wrt get/set regs [not found] ` <1256454909-22861-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> @ 2012-04-22 18:56 ` Michael Kerrisk (man-pages) [not found] ` <CAKgNAkgntJqu4UkeusJV-oak6ksM6_Y4z3GeYTfg0JD2tQ4jww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2012-04-22 18:56 UTC (permalink / raw) To: Mike Frysinger; +Cc: Denys Vlasenko, Oleg Nesterov, linux-man [Adding some ptrace-knowledgeable people to CC] Mike, You long ago sent the patch below, but I didn't respond. I'm just pulling up a few old ptrace pieces now for review. Your patch below relates to PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_SETREGS, PTRACE_SETFPREGS. (The patch below no longer is current, but is easy to fix) Looking at arch/sparc/kernel/ptrace_32.c, I think I see what the point of the patch is. However, the text is a bit cryptic. Would it not be better to say something like [[ Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP reversed; that is, \fIdata\fP is ignored and the registers are copied to [from] \fIaddr\fP. ]] Cheers, Michael ---------- Forwarded message ---------- From: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> Date: Sun, Oct 25, 2009 at 8:15 PM Subject: [PATCH] ptrace(2): note SPARC deviation wrt get/set regs To: Michael Kerrisk <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Unfortunately the SPARC ptrace port handles the addr/data args the opposite of every other arch. It expects the struct to be in addr and the data is ignored. Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> --- man2/ptrace.2 | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/man2/ptrace.2 b/man2/ptrace.2 index 68601df..7cce955 100644 --- a/man2/ptrace.2 +++ b/man2/ptrace.2 @@ -168,6 +168,8 @@ respectively, to location \fIdata\fP in the parent. See \fI<sys/user.h>\fP for information on the format of this data. (\fIaddr\fP is ignored.) + +Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP reversed. .TP .BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)" Retrieve information about the signal that caused the stop. @@ -184,6 +186,8 @@ As for some general purpose register modifications may be disallowed. (\fIaddr\fP is ignored.) + +Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP reversed. .TP .BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)" Set signal information. -- 1.6.5.1 -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <CAKgNAkgntJqu4UkeusJV-oak6ksM6_Y4z3GeYTfg0JD2tQ4jww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] ptrace(2): note SPARC deviation wrt get/set regs [not found] ` <CAKgNAkgntJqu4UkeusJV-oak6ksM6_Y4z3GeYTfg0JD2tQ4jww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2012-04-24 3:55 ` Mike Frysinger [not found] ` <201204232355.39879.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Mike Frysinger @ 2012-04-24 3:55 UTC (permalink / raw) To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w Cc: Denys Vlasenko, Oleg Nesterov, linux-man [-- Attachment #1: Type: Text/Plain, Size: 820 bytes --] On Sunday 22 April 2012 14:56:14 Michael Kerrisk (man-pages) wrote: > You long ago sent the patch below, but I didn't respond. I'm just > pulling up a few old ptrace pieces now for review. > > Your patch below relates to PTRACE_GETREGS, PTRACE_GETFPREGS, > PTRACE_SETREGS, PTRACE_SETFPREGS. (The patch below no longer is > current, but is easy to fix) > > Looking at arch/sparc/kernel/ptrace_32.c, I think I see what the point > of the patch is. However, the text is a bit cryptic. Would it not be > better to say something like seemed clear to me, but i wrote it ;) > [[ > Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP > reversed; that is, \fIdata\fP is ignored and the registers are copied to > [from] \fIaddr\fP. > ]] i'd suggest "via" rather than "to [from]" -mike [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <201204232355.39879.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] ptrace(2): note SPARC deviation wrt get/set regs [not found] ` <201204232355.39879.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> @ 2012-04-24 6:05 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2012-04-24 6:05 UTC (permalink / raw) To: Mike Frysinger; +Cc: Denys Vlasenko, Oleg Nesterov, linux-man On Tue, Apr 24, 2012 at 3:55 PM, Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> wrote: > On Sunday 22 April 2012 14:56:14 Michael Kerrisk (man-pages) wrote: >> You long ago sent the patch below, but I didn't respond. I'm just >> pulling up a few old ptrace pieces now for review. >> >> Your patch below relates to PTRACE_GETREGS, PTRACE_GETFPREGS, >> PTRACE_SETREGS, PTRACE_SETFPREGS. (The patch below no longer is >> current, but is easy to fix) >> >> Looking at arch/sparc/kernel/ptrace_32.c, I think I see what the point >> of the patch is. However, the text is a bit cryptic. Would it not be >> better to say something like > > seemed clear to me, but i wrote it ;) > >> [[ >> Note that SPARC systems have the meaning of \fIdata\fP and \fIaddr\fP >> reversed; that is, \fIdata\fP is ignored and the registers are copied to >> [from] \fIaddr\fP. >> ]] > > i'd suggest "via" rather than "to [from]" Thanks Mike. I've applied the patch below for 3.40. Cheers, Michael --- a/man2/ptrace.2 +++ b/man2/ptrace.2 @@ -213,24 +213,32 @@ some modifications to the USER area are disallowed. .\" and when they are disallowed, how does userspace discover that fact? .TP .BR PTRACE_GETREGS ", " PTRACE_GETFPREGS Copy the tracee's general-purpose or floating-point registers, respectively, to the address .I data in the tracer. See .I <sys/user.h> for information on the format of this data. .RI ( addr is ignored.) +Note that SPARC systems have the meaning of +.I data +and +.I addr +reversed; that is, +.I data +is ignored and the registers are copied to the address +.IR addr . .TP .BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)" Retrieve information about the signal that caused the stop. Copy a .I siginfo_t structure (see .BR sigaction (2)) from the tracee to the address .I data in the tracer. .RI ( addr is ignored.) @@ -238,24 +246,32 @@ is ignored.) .BR PTRACE_SETREGS ", " PTRACE_SETFPREGS Copy the tracee's general-purpose or floating-point registers, respectively, from the address .I data in the tracer. As for .BR PTRACE_POKEUSER , some general-purpose register modifications may be disallowed. .\" FIXME In the preceding sentence, which modifications are disallowed, .\" and when they are disallowed, how does userspace discover that fact? .RI ( addr is ignored.) +Note that SPARC systems have the meaning of +.I data +and +.I addr +reversed; that is, +.I data +is ignored and the registers are copied from the address +.IR addr . .TP .BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)" Set signal information: copy a .I siginfo_t structure from the address .I data in the tracer to the tracee. This will affect only signals that would normally be delivered to the tracee and were caught by the tracer. It may be difficult to tell these normal signals from synthetic signals generated by -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-24 6:05 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-25 7:15 [PATCH] ptrace(2): note SPARC deviation wrt get/set regs Mike Frysinger [not found] ` <1256454909-22861-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 2012-04-22 18:56 ` Michael Kerrisk (man-pages) [not found] ` <CAKgNAkgntJqu4UkeusJV-oak6ksM6_Y4z3GeYTfg0JD2tQ4jww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2012-04-24 3:55 ` Mike Frysinger [not found] ` <201204232355.39879.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 2012-04-24 6:05 ` Michael Kerrisk (man-pages)
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).