Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-06-03 21:07:52 +0000
committerEugene Tarassov2016-06-03 21:07:52 +0000
commitfb3d8bfce74199b789368682ff85b1d692e85d5b (patch)
treefe478b9a4b4e91308822bb4fc362294c3c1b38ea /plugins
parent0a456fe80ed50a99ec6ab45cdcd014cfed793910 (diff)
downloadorg.eclipse.tcf-fb3d8bfce74199b789368682ff85b1d692e85d5b.tar.gz
org.eclipse.tcf-fb3d8bfce74199b789368682ff85b1d692e85d5b.tar.xz
org.eclipse.tcf-fb3d8bfce74199b789368682ff85b1d692e85d5b.zip
TCF Debugger: fixed: launch sequence stalls if agent does not provide Breakpoints service
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java108
1 files changed, 55 insertions, 53 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
index 37269f8fd..4fb363653 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
@@ -393,66 +393,68 @@ public class TCFBreakpointsModel {
assert !disposed;
assert Protocol.isDispatchThread();
final IBreakpoints service = channel.getRemoteService(IBreakpoints.class);
- if (service != null) {
- service.getCapabilities(null, new IBreakpoints.DoneGetCapabilities() {
- public void doneGetCapabilities(IToken token, Exception error, Map<String,Object> capabilities) {
- if (channel.getState() != IChannel.STATE_OPEN) {
- Protocol.invokeLater(done);
- return;
- }
- if (channels.isEmpty()) {
- bp_manager.addBreakpointListener(breakpoint_listener);
- bp_manager.addBreakpointManagerListener(manager_listener);
+ if (service == null) {
+ Protocol.invokeLater(done);
+ return;
+ }
+ service.getCapabilities(null, new IBreakpoints.DoneGetCapabilities() {
+ public void doneGetCapabilities(IToken token, Exception error, Map<String,Object> capabilities) {
+ if (channel.getState() != IChannel.STATE_OPEN) {
+ Protocol.invokeLater(done);
+ return;
+ }
+ if (channels.isEmpty()) {
+ bp_manager.addBreakpointListener(breakpoint_listener);
+ bp_manager.addBreakpointManagerListener(manager_listener);
+ }
+ channel.addChannelListener(new IChannel.IChannelListener() {
+ public void congestionLevel(int level) {
}
- channel.addChannelListener(new IChannel.IChannelListener() {
- public void congestionLevel(int level) {
+ public void onChannelClosed(Throwable error) {
+ if (disposed) return;
+ channels.remove(channel);
+ if (channels.isEmpty()) {
+ bp_manager.removeBreakpointListener(breakpoint_listener);
+ bp_manager.removeBreakpointManagerListener(manager_listener);
+ id2bp.clear();
}
- public void onChannelClosed(Throwable error) {
- if (disposed) return;
- channels.remove(channel);
- if (channels.isEmpty()) {
- bp_manager.removeBreakpointListener(breakpoint_listener);
- bp_manager.removeBreakpointManagerListener(manager_listener);
- id2bp.clear();
- }
+ }
+ public void onChannelOpened() {
+ }
+ });
+ channels.put(channel, capabilities);
+ IBreakpoint[] arr = bp_manager.getBreakpoints();
+ if (arr != null && arr.length > 0) {
+ List<Map<String,Object>> bps = new ArrayList<Map<String,Object>>(arr.length);
+ for (int i = 0; i < arr.length; i++) {
+ try {
+ if (!isSupported(channel, arr[i])) continue;
+ String id = getBreakpointID(arr[i]);
+ if (id == null) continue;
+ if (!arr[i].isPersisted()) continue;
+ IMarker marker = arr[i].getMarker();
+ String file = getFilePath(marker.getResource());
+ bps.add(toBreakpointAttributes(channel, id, file, marker.getType(), marker.getAttributes()));
+ id2bp.put(id, arr[i]);
}
- public void onChannelOpened() {
+ catch (Exception x) {
+ Activator.log("Cannot get breakpoint attributes", x);
}
- });
- channels.put(channel, capabilities);
- IBreakpoint[] arr = bp_manager.getBreakpoints();
- if (arr != null && arr.length > 0) {
- List<Map<String,Object>> bps = new ArrayList<Map<String,Object>>(arr.length);
- for (int i = 0; i < arr.length; i++) {
- try {
- if (!isSupported(channel, arr[i])) continue;
- String id = getBreakpointID(arr[i]);
- if (id == null) continue;
- if (!arr[i].isPersisted()) continue;
- IMarker marker = arr[i].getMarker();
- String file = getFilePath(marker.getResource());
- bps.add(toBreakpointAttributes(channel, id, file, marker.getType(), marker.getAttributes()));
- id2bp.put(id, arr[i]);
- }
- catch (Exception x) {
- Activator.log("Cannot get breakpoint attributes", x);
+ }
+ if (!bps.isEmpty()) {
+ Map<String, Object>[] bp_arr = (Map<String,Object>[])bps.toArray(new Map[bps.size()]);
+ service.set(bp_arr, new IBreakpoints.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error == null) done.run();
+ else channel.terminate(error);
}
- }
- if (!bps.isEmpty()) {
- Map<String, Object>[] bp_arr = (Map<String,Object>[])bps.toArray(new Map[bps.size()]);
- service.set(bp_arr, new IBreakpoints.DoneCommand() {
- public void doneCommand(IToken token, Exception error) {
- if (error == null) done.run();
- else channel.terminate(error);
- }
- });
- return;
- }
+ });
+ return;
}
- Protocol.invokeLater(done);
}
- });
- }
+ Protocol.invokeLater(done);
+ }
+ });
}
private String getFilePath(IResource resource) throws IOException {

Back to the top