On Wed, 2007-09-26 at 13:33 -0700, Roland McGrath wrote: > > Would this hack work: have the second utrace engine refuse to put a > > breakpoint wherever it suspects another engine may have put one? > > Sure, it's easy to notice the breakpoint instruction already there.
Would the second engine then also get an event notification when the existing breakpoint gets hit? If so then it would be nice to have a mechanism to detect a breakpoint being removed so an engine could say "wait! I am still interested in monitoring when that address gets hit, please keep that breakpoint there", and then just have the first engine not be notified of any breakpoint events anymore, and only notify the second engine from then on. (This is kind of what we do in Frysk, but there of course we do all breakpoint handling in user space through one ptrace wait monitoring thread that dispatches the events, so we are in control of all breakpoint setting and breakpoint hit event detection.) Cheers, Mark