Community
Participate
Working Groups
I20061129-1340 Found while looking at bug 166761: take the example from that bug but don't step into selection. Instead simply close the editor. ==> InstructionPointerContext references the closed editor and hence an instance stays around until the debugger is terminated.
Investigate for 3.3
Dani suggest that we might try a ISaveablesLifecycleListener rather than a part listener. via: (ISaveablesLifecycleListener)editor.getSite().getService(ISaveablesLifecycleListener.class)
>Dani suggest that we might try a ISaveablesLifecycleListener rather than a part >listener. Just to be clear: I would recommend to use the part listener ;-)
Created attachment 64897 [details] Fix Fix clears out no longer needed annotations when the editor is closed or it's input changes. The way the pointers were cached has been changed to improve performance (mapping of debug targets and threads was removed, mapping of editors to annotations was added). Issues: 1) Concurrent modification exception was occuring occasionally. See Bug 69289, and Bug 184027. To try and avoid this, the StackFrameSourceDisplayAdapter was altered to ensure that annotation model changes were being done in the ui thread. The problem still occurs, but it very difficult to reproduce. One possible solution would be synchronize on the AnnotationModel object, but this risks deadlock. 2) To improve performance, we should consider using the replace method on the annotation model when removing groups of annotations (target or thread resumed). Using one call to replace is faster than removing each one individually. 3) Tests should be added to test this manager.
Fixed in HEAD. See InstructionPointerContext, InstructionPointerManager, StackFrameSourceDisplayAdapter, InstructionPointerTests. I will be adding a new test suite to fully test the manager in the near future once a couple transient failures in them can be tracked down.
Darin please verify
Verified.
Created attachment 65286 [details] Patch for tests (work in progress) The patch adds a new test suite to test InstructionPointerManager. As they are still a work in progress, they print a lot of text to the console and the automated suite has been changed to just run the new suite. Things to fix: 1) In rare cases, at the end of the test without editor reuse, immediately after all the editors have been closed, a new annotation is added. This puts the final IPC count at 1, not 0, failing the test. 2) In both tests (with and without editor reuse) selecting the second stack frame in the same thread will sometimes not add the annotation. This results in a long wait and a failed test. 3) In the test without editor reuse, the closing of the editor containing ThreadStack will sometimes wait (the wait is not stopped early by notifyAll. 4) A part listener is added to listen for input changes, it is not currently removed.
Tests were added to HEAD, but not included in the automated tests as they occasionally fail.