When you register one (observer, address) combination to several tasks, the observer gets one updateHit for each registration when any of the tasks hits the breakpoint.
Clarification. The updateHit is really called several times, with the same combination of task and address. This ltrace output snippet exhibits the problem: [22688] call thr->printf(3215026272, 0, 0, 0)\ [22688] call thr->printf(3215026272, 0, 0, 0)\ [22688] call thr->printf(3215026272, 0, 0, 0)\ [22688] call thr->printf(3215026272, 0, 0, 0)\ [22688] call thr->printf(3215026272, 0, 0, 0)\ [22688] call thr->printf(3215026272, 0, 0, 0) [22688] syscall write(4, 4 , 3086082048)4 [22688] syscall leave write = 2 [22688] leave printf = 2 [22688] leave printf = 2 [22688] leave printf = 2 [22688] leave printf = 2 [22688] leave printf = 2
I added a testcase, testMultiTaskUpdateCalledSeveralTimes.
commit c9b6156e7b4d4ab4ccb29024e22625901595c15b Author: Mark Wielaard <mwielaard@redhat.com> Date: Mon Apr 21 12:24:08 2008 +0200 Record Task registering TaskObserver.Code with BreakpointAddresses. Bug #5234. frysk-core/frysk/proc/live/ChangeLog 2008-04-21 Mark Wielaard <mwielaard@redhat.com> * BreakpointAddresses.java: Mark class and methods package private. (CodeObserver): New final static helper class. (addBreakpoint): Take CodeObserver as argument, not TaskObserver.Code. (removeBreakpoint): Likewise. (getCodeObservers): Return collection of CodeObservers, not TaskObserver.Code. * LinuxPtraceProc.java (BreakpointAction.run): Install or remove BreakpointAddresses.CodeObserver instead of bare TaskObserver.Code. * LinuxPtraceTask.java (notifyCodeBreakpoint): Check Task against BreakpointAddresses.CodeObserver. * TestTaskObserverCode.java (testMultiTaskUpdateCalledSeveralTimes): Resolved bug #5234.