* [parisc-linux] glibc and ptrace
@ 2000-12-19 18:22 Richard Hirst
2000-12-19 19:59 ` Jes Sorensen
2000-12-21 13:19 ` Richard Hirst
0 siblings, 2 replies; 5+ messages in thread
From: Richard Hirst @ 2000-12-19 18:22 UTC (permalink / raw)
To: parisc-linux
I have a problem with ptrace. The ptrace syscall for PTRACE_PEEK*
saves the result in *data (4th arg), whereas the man page says
it returns the result as the return value, and the 4th arg is
ignored. userland things, like strace for example, expect the
man page behaviour. I assumed glibc should be providing a wrapper
to translate from kernel to userland syntax, but our glibc doesn't
appear to do so.
I had a look at glibc and found the wrapper code in
sysdeps/unix/sysv/linux/ptrace.c but that isn't included in the
build. Instead I end up with misc/ptrace.o being a raw syscall.
I then found sysdeps/unix/sysv/linux/hppa/syscalls.list and commented
out the ptrace line in there and rebuilt. This time it looks like
misc/ptrace.o has the proper wrapper in it (although I havn't
actually tried to run it).
So, should I be fixing glibc (if removing that line is indeed a fix),
or should I be fixing our kernel source so the glibc wrapper isn't needed?
ia64, for example seems to fix it in the kernel, while sparc64 looks
like it uses the glibc wrapper.
(my strace port only works atm because it has its own wrapper, and
I'm trying to tidy that up).
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [parisc-linux] glibc and ptrace
2000-12-19 18:22 [parisc-linux] glibc and ptrace Richard Hirst
@ 2000-12-19 19:59 ` Jes Sorensen
2000-12-19 20:14 ` Richard Hirst
2000-12-21 13:19 ` Richard Hirst
1 sibling, 1 reply; 5+ messages in thread
From: Jes Sorensen @ 2000-12-19 19:59 UTC (permalink / raw)
To: Richard Hirst; +Cc: parisc-linux
>>>>> "Richard" == Richard Hirst <rhirst@linuxcare.com> writes:
Richard> So, should I be fixing glibc (if removing that line is indeed
Richard> a fix), or should I be fixing our kernel source so the glibc
Richard> wrapper isn't needed? ia64, for example seems to fix it in
Richard> the kernel, while sparc64 looks like it uses the glibc
Richard> wrapper.
I'd say fix it in the kernel if it's cheaper to do so. You can stick a
wrapper in glibc as well, but it sounds to be simpler to do in the
kernel.
Jes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [parisc-linux] glibc and ptrace
2000-12-19 19:59 ` Jes Sorensen
@ 2000-12-19 20:14 ` Richard Hirst
2000-12-19 20:39 ` Jes Sorensen
0 siblings, 1 reply; 5+ messages in thread
From: Richard Hirst @ 2000-12-19 20:14 UTC (permalink / raw)
To: Jes Sorensen; +Cc: parisc-linux
On Tue, Dec 19, 2000 at 08:59:49PM +0100, Jes Sorensen wrote:
> >>>>> "Richard" == Richard Hirst <rhirst@linuxcare.com> writes:
>
> Richard> So, should I be fixing glibc (if removing that line is indeed
> Richard> a fix), or should I be fixing our kernel source so the glibc
> Richard> wrapper isn't needed? ia64, for example seems to fix it in
> Richard> the kernel, while sparc64 looks like it uses the glibc
> Richard> wrapper.
>
> I'd say fix it in the kernel if it's cheaper to do so. You can stick a
> wrapper in glibc as well, but it sounds to be simpler to do in the
> kernel.
Kernel fix does seem more sensible, I just wonder if there is
a general move towards doing it one way rather than the other.
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [parisc-linux] glibc and ptrace
2000-12-19 20:14 ` Richard Hirst
@ 2000-12-19 20:39 ` Jes Sorensen
0 siblings, 0 replies; 5+ messages in thread
From: Jes Sorensen @ 2000-12-19 20:39 UTC (permalink / raw)
To: Richard Hirst; +Cc: parisc-linux
>>>>> "Richard" == Richard Hirst <rhirst@linuxcare.com> writes:
Richard> On Tue, Dec 19, 2000 at 08:59:49PM +0100, Jes Sorensen wrote:
>> I'd say fix it in the kernel if it's cheaper to do so. You can
>> stick a wrapper in glibc as well, but it sounds to be simpler to do
>> in the kernel.
Richard> Kernel fix does seem more sensible, I just wonder if there is
Richard> a general move towards doing it one way rather than the
Richard> other.
I don't see a trend, a kernel fix allows us to inline the syscall
which is always nice.
Jes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: glibc and ptrace
2000-12-19 18:22 [parisc-linux] glibc and ptrace Richard Hirst
2000-12-19 19:59 ` Jes Sorensen
@ 2000-12-21 13:19 ` Richard Hirst
1 sibling, 0 replies; 5+ messages in thread
From: Richard Hirst @ 2000-12-21 13:19 UTC (permalink / raw)
To: parisc-linux
On Tue, Dec 19, 2000 at 06:22:57PM +0000, Richard Hirst wrote:
> I have a problem with ptrace. The ptrace syscall for PTRACE_PEEK*
> saves the result in *data (4th arg), whereas the man page says
> it returns the result as the return value, and the 4th arg is
> ignored. userland things, like strace for example, expect the
> man page behaviour. I assumed glibc should be providing a wrapper
> to translate from kernel to userland syntax, but our glibc doesn't
> appear to do so.
Turned out I had to fix glibc to use the wrapper on parisc. This
means our strace source will be broken for new glibc builds. I'll
fix strace once the glibc change propagates through. If anyone
wants to fix their own strace for testing, just remove the raw_ptrace
stuff from strace/defs.h
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-12-21 13:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-19 18:22 [parisc-linux] glibc and ptrace Richard Hirst
2000-12-19 19:59 ` Jes Sorensen
2000-12-19 20:14 ` Richard Hirst
2000-12-19 20:39 ` Jes Sorensen
2000-12-21 13:19 ` Richard Hirst
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.