tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with using PT_SYSCALL.



Valeriy E. Ushakov wrote:
Artem Anisimov<aanisimov%inbox.ru@localhost>  wrote:

  The attached problem is supposed to run "/bin/ls /" and stop at
every system call it makes. The problem is that
ptrace(PT_SYSCALL,...) at the end of the main loop seems simply to
resume the child and make it run until it exits, but not until it
makes a system call.

  Attached program works as expected under FreeBSD and Linux, so I
believe there is some detail that needs to be taken into account for
NetBSD and that I have missed.

Seems to work for me under NetBSD/macppc 4-stable and
NetBSD/landisk 5.99.24:

...
child stopped by signal 5 (Trace/BPT trap)
resuming the child
altroot   etc       lib       modules   root      testroot
child stopped by signal 5 (Trace/BPT trap)
resuming the child
child stopped by signal 5 (Trace/BPT trap)
resuming the child
...

-uwe


NetBSD/i386 5.1_RC3:

$ cc -DBSD prog.c
$ ./a.out
child stopped by signal 5 (Trace/BPT trap)
resuming the child
[list of /]
child exited with status 0
$

r.



Home | Main Index | Thread Index | Old Index