Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] ElementContentProvider returns some children but IModelSelectionPolicy#replaceInvalidSelection is called as if the children were missing in the tree viewer

Hello Pawel,

Happy to report that the problem is fixed. For the record follows a description of this issue.

1. equals and hashCode are not involved.
2. In my design the thread content provider filters out some "uninteresting" frames.
3. However, once the children of a given thread are fetched, the automatic selection mechanism uses directly the IThread#getStackFrames() (not the associated content provider, as one might expect) to computed the indexes of the frames to set the selection on.
4. IThread#getStackFrames() returns unfiltered list of frames, and causes the index calculation to fail (since it tries to match filtered frames with an unfiltered lists of frames).
5. The fix was to have IThread#getStackFrames() method return filtered list of frames. Content provider now delegates to IThread filtering interesting frames.

I am not sure this is a bug on the eclipse part, but certainly something I did not expect (I expected that my content provider would be a single source for all queries in the Launch View, which is wrong).

Vladimir

On Mon, Aug 3, 2009 at 10:55 AM, Pawel Piech <pawel.piech@xxxxxxxxxxxxx> wrote:
Hi Gusev,
I have seen similar issues before.  Usually the problem is that the delta which makes the selection in the view is not consistent with the data returned by the content provider.  One important point is that if different frame instances are used, their equals() and hashCode() should be implemented.

Hope this helps,
Pawel

Vladimir Gusev wrote:
Thanks Darin,

It seems that this happens when the updates of the LaunchView related to the resume action are caught up with the following suspend event. If I introduce an artificial 5 sec sleep delay on the breakpoint thread when the breakpoint suspend event is received, this issue goes away.

>From this observation, the solution seems to be a synchronization of the suspend and resume - related udates of the LaunchView: make sure the view is fully updated by the resume event, before queuing next suspend event.

Do you have any recommendations for this type of synchronization? Jobs with scheduling rules?

Thanks a lot.

Vladimir

On Wed, Jul 29, 2009 at 1:17 PM, Darin Wright <Darin_Wright@xxxxxxxxxx> wrote:
I have not seen/heard of this issue before.

You could try turning on some tracing options to see if it helps debug the
problem, such as:

debug/viewers/contentProvider
debug/viewers/deltas
debug/viewers/updateSequence

Darin Wright



From:
Vladimir Gusev <zaboba@xxxxxxxxx>
To:
"Eclipse Platform Debug component developers list."
<platform-debug-dev@xxxxxxxxxxx>
Date:
07/28/2009 04:09 PM
Subject:
[platform-debug-dev] ElementContentProvider returns some children but
IModelSelectionPolicy#replaceInvalidSelection   is called as if the
children were missing in the tree viewer
Sent by:
platform-debug-dev-bounces@xxxxxxxxxxx



Hello,

In some reproducible scenario my implementation of ElementContentProvider
returns correct children (stack frames), however when viewer tries to set
a selection on a top frame, it is not in the in the viewer's tree.
Therefore IModelSelectionPolicy#replaceInvalidSelection method is called.
In the latter can confirm that indeed children just returned by the
ElementContentProvider did not make it to the tree.

Once the selection calculated by IModelSelectionPolicy has been set,
however, I can see the children in question happily attached to their
parent (thread) in the LaunchView.

Not being able to set selection on the model's children breaks the debug
context, updates of the VariablesView and does other bad things. The user
has to know that he must manually select a child in order to proceed with
the debugging process.

It seems that the updates from the model somehow get to the viewer AFTER
the selection is being attempted to be set for the top child (frame).

How can I prevent this seemingly concurrent issue? From what I read here
http://www.slideshare.net/guest3bd2a12/debug-tutorial-custom-integration-presentation-668660
asynchronous ElementContentProvider is supposed to notify its listeners on
the completion of the child updates. It seems that somehow this
notification happens either out of order, or the content of the child
updates is somehow get broken.

Any thoughts would be greatly appreciated.

Thanks.

Vladimir_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev



_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev


_______________________________________________ platform-debug-dev mailing list platform-debug-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/platform-debug-dev


_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev



Back to the top