HomeFreeBSD

If you have pressed CTRL+Z and a process is suspended, then you use gdb

Description

If you have pressed CTRL+Z and a process is suspended, then you use gdb
to attach to the process, it is surprising that the process is resumed
without inputting any gdb commands, however ptrace manual said:

The tracing process will see the newly-traced process stop and may
then control it as if it had been traced all along.

But the current code does not work in this way, unless traced process
received a signal later, it will continue to run as a background task.
To fix this problem, just send signal SIGSTOP to the traced process after
we resumed it, this works like that you are attaching to a running process,
it is not perfect but better than nothing.

Details

Provenance
David Xu <davidxu@FreeBSD.org>Authored on Jul 9 2012, 9:24 AM
Parents
rG3d184db2f82e: Further preparations for the RX EDMA support.
Branches
Unknown
Tags
Unknown

Event Timeline