Community
Participate
Working Groups
EDC can create TCF channels on behalf of clients but is not listening to errors or close events on those channels. Thus, when debugging under EDC and a debug agent dies or a device is disconnected, the EDC session will usually sit waiting for a long time. Terminating the session through the UI will further hang because EDC tries to send commands on the dead channel and wait for responses. Also, just in general, it's a bit of a hack in other parts of EDC to interact with peers and channels that EDC has created internally (i.e. via TCFServiceManager#getPeerService). ITCFServiceManager only exposes a way to get an existing channel on a peer, but no way to directly discover what channels it has opened internally on a peer via #getChannelForPeer(). I propose solving both of these problems in a general way by allowing clients to register a listeners on ITCFServiceManager, which informs when an IPeer/IChannel combination is opened or closed. Then, the AbstractFinalLaunchSequence#initFindPeerStep() can add such a listener and terminate the debug session when its peer/channel tuple dies. QUESTION: what is the proposed way to alert the user when the debug session is killed? I.e. are we allowed to put up UI?
Created attachment 179053 [details] proposed patch
Created attachment 179079 [details] updated patch This is another revision which allows a subclass to control how it reacts to the connection closed event and improves the Javadoc. Does this look safe, Ken?
I merged in these changes to sync with our product build.
*** cdt cvs genie on behalf of eswartz *** Bug 325501: allow detecting when TCF channel is closed, to terminate debug session. [+] ITCFConnectionListener.java http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/ITCFConnectionListener.java?root=Tools_Project&revision=1.1&view=markup [*] ITCFServiceManager.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/ITCFServiceManager.java?root=Tools_Project&r1=1.3&r2=1.4 [*] TCFServiceManager.java 1.27 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/internal/TCFServiceManager.java?root=Tools_Project&r1=1.26&r2=1.27 [*] AbstractFinalLaunchSequence.java 1.37 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/launch/AbstractFinalLaunchSequence.java?root=Tools_Project&r1=1.36&r2=1.37