I asked this question in the reverse engineering stackexchange: https://reverseengineering.stackexchange.com/questions/15169/transferring-control-of-ptrace-to-another-process because I thought a ptrace question was most appropriate there.
I didn't get any bites, I don't know if that is because there are too few people there, or they are not that familiar with linux. In any event, I thought I would ask here.
I would like to create a process A. In A I would like to start a second process B. I would like A to go on and monitor system resources. When certain conditions are met I want A to ptrace B, start gdb and transfer ptrace control to gdb.
Is this possible? If not is there a way A can pause B, start gdb with B atttached and then "unpause" B?