From: Kevin Buettner <kev@primenet.com>
To: Kumar Gala <kumar@chaos.ph.utexas.edu>,
linuxppc-dev <linuxppc-dev@lists.linuxppc.org>
Subject: Re: ptrace
Date: Wed, 27 Oct 1999 22:00:00 -0700 [thread overview]
Message-ID: <991028045959.ZM28466@saguaro.lan> (raw)
In-Reply-To: Kumar Gala <kumar@chaos.ph.utexas.edu> "ptrace" (Oct 27, 1:31pm)
On Oct 27, 1:31pm, Kumar Gala wrote:
> Does anyone know why ptrace will only read and write a word at a time. I
> know libc limits this but is there any reason.
>
> The reason I ask is it seems from looking at other Unix implementations of
> ptrace that for operations like reading all the registers on a machine,
> or reading writing FP (and now AltiVec registers) that this is a big
> waste.
>
> ie. if I want to dump all the registers for the a process (GPRs, FPs, VRs)
> It is going to take 224 system calls with the current implementation.
>
> 32 (for GPRs) + 64 (for FPs) + 128 (for VRs)
>
> plus additional calls for any status registers (PC, CRn, FPSCR, VSCR,
> etc.)
>
> rather being able to make a single call to ptrace to dump all the
> registers, 3 calls - one for GPRs, one for FPs, one for VRs would be much
> more efficient.
>
> I think it is something that should be fixed, and most likely we could
> maintain the 'IMHO broken' way that things are currently done, and still
> have the nicer features I am taking about.
If you look at the Linux kernel sources, you'll see that i386, m68k,
sparc, sparc64, and sh all implement PTRACE_GETREGS and
PTRACE_SETREGS. Some of them implement some other variants. E.g,
i386 also has a PTRACE_GETFPREGS and PTRACE_SETFPREGS as does the
sparc (which has a number of others as well).
I don't think there is any technical reason that would prevent
PTRACE_GETREGS / PTRACE_SETREGS from being implemented for the PPC.
And I agree with you; gdb could be much more efficient at fetching
and setting registers if these ptrace operations were defined.
Kevin
--
Kevin Buettner
kev@primenet.com, kevinb@cygnus.com
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
prev parent reply other threads:[~1999-10-28 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-27 18:31 ptrace Kumar Gala
1999-10-28 5:00 ` Kevin Buettner [this message]
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=991028045959.ZM28466@saguaro.lan \
--to=kev@primenet.com \
--cc=kumar@chaos.ph.utexas.edu \
--cc=linuxppc-dev@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).