From: Daniel Jacobowitz <dan@debian.org>
To: Roland McGrath <roland@redhat.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: PTRACE_GET_THREAD_AREA
Date: Fri, 20 Dec 2002 10:48:29 -0500 [thread overview]
Message-ID: <20021220154829.GB17007@nevyn.them.org> (raw)
In-Reply-To: <200212200832.gBK8Wfg29816@magilla.sf.frob.com>
On Fri, Dec 20, 2002 at 12:32:41AM -0800, Roland McGrath wrote:
> This patch vs 2.5.51 (should apply fine to 2.5.52) adds two new ptrace
> requests for i386, PTRACE_GET_THREAD_AREA and PTRACE_SET_THREAD_AREA.
> These let another process using ptrace do the equivalent of performing
> get_thread_area and set_thread_area system calls for another thread.
>
> We are working on gdb support for the new threading code in the kernel
> using the new NPTL library, and use PTRACE_GET_THREAD_AREA for that.
> This patch has been working fine for that.
>
> I added PTRACE_SET_THREAD_AREA just for completeness, so that you can
> change all the state via ptrace that you can read via ptrace as has
> previously been the case. It doesn't have an equivalent of set_thread_area
> with .entry_number = -1, but is otherwise the same.
>
> Both requests use the ptrace `addr' argument for the entry number rather
> than the entry_number field in the struct. The `data' parameter gives the
> address of a struct user_desc as used by the set/get_thread_area syscalls.
>
> The code is quite simple, and doesn't need any special synchronization
> because in the ptrace context the thread must be stopped already.
>
> I chose the new request numbers arbitrarily from ones not used on i386.
> I have no opinion on what values should be used.
>
> People I talked to preferred adding this interface over putting an array of
> struct user_desc in struct user as accessed by PTRACE_PEEKUSR/POKEUSR
> (which would be a bit unnatural since those calls access one word at a time).
In general, I like this. However, I have to ask one question: how much
of the i386-centrism of this patch is actually necessary? What
information does GDB _use_ from this, and is there some way we can
expose it that will be useful in other places?
Eventually most or all targets will have thread-specific data
implemented; I don't want to have to redo this for each one.
Your choice of numbers is fine if this remains i386-centric; if we
expect there to be a common interface then it should go in
<linux/ptrace.h> and the 0x4200 range instead.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-12-20 15:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-20 8:32 PTRACE_GET_THREAD_AREA Roland McGrath
2002-12-20 10:24 ` PTRACE_GET_THREAD_AREA Christoph Hellwig
2002-12-20 15:44 ` PTRACE_GET_THREAD_AREA Daniel Jacobowitz
2002-12-20 17:36 ` PTRACE_GET_THREAD_AREA Linus Torvalds
2002-12-20 15:48 ` Daniel Jacobowitz [this message]
2002-12-20 15:55 ` PTRACE_GET_THREAD_AREA Jakub Jelinek
2002-12-20 16:08 ` PTRACE_GET_THREAD_AREA Daniel Jacobowitz
2002-12-20 21:27 ` PTRACE_GET_THREAD_AREA Roland McGrath
2002-12-20 17:42 ` PTRACE_GET_THREAD_AREA Linus Torvalds
2003-01-13 3:51 ` PTRACE_GET_THREAD_AREA Roland McGrath
2003-01-13 4:03 ` PTRACE_GET_THREAD_AREA Linus Torvalds
2003-01-13 5:29 ` PTRACE_GET_THREAD_AREA Roland McGrath
[not found] <3E22B2F0.31397.E719685@localhost>
2003-01-14 3:15 ` PTRACE_GET_THREAD_AREA Roland McGrath
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=20021220154829.GB17007@nevyn.them.org \
--to=dan@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roland@redhat.com \
/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