I have a process that is called by another process which is called by another process and so on ad nauseum. It\'s a child process in a long tool chain.
One of the programs in Tom Tromey's gdb-helpers repository on GitHub is preattach, which will make gdb attach to the next process created with a given name. It requires the Linux systemtap program.