diff options
author | Eugene Tarassov | 2012-11-08 01:59:56 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-11-08 01:59:56 +0000 |
commit | 5657bb35c04fcd1e34d6f7aba9f20b99b3b34ce2 (patch) | |
tree | 4f3fb7617fc3243669f77209f993a45833e71d55 /plugins | |
parent | 7335ed8d26592cd499b7fb607eace4502f8e71e1 (diff) | |
download | org.eclipse.tcf-5657bb35c04fcd1e34d6f7aba9f20b99b3b34ce2.tar.gz org.eclipse.tcf-5657bb35c04fcd1e34d6f7aba9f20b99b3b34ce2.tar.xz org.eclipse.tcf-5657bb35c04fcd1e34d6f7aba9f20b99b3b34ce2.zip |
TCF Debugger: better error reporting when starting local TCF agent
Diffstat (limited to 'plugins')
2 files changed, 37 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java index ecdad2606..5367ba7e8 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2010, 2012 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -84,7 +84,7 @@ class TCFBreakpointStatusListener { public void breakpointAdded(IBreakpoint breakpoint) {} public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { - updateBreakpoint(breakpoint, false); + updateBreakpoint(breakpoint, false); } public void breakpointRemoved(final IBreakpoint breakpoint, IMarkerDelta delta) { updateBreakpoint(breakpoint, true); @@ -104,10 +104,11 @@ class TCFBreakpointStatusListener { createOrUpdateBreakpoint(marker_id); } }); - - } catch (CoreException e) {} + } + catch (CoreException e) { + } } - + private void updateStatus(String id, IBreakpoint bp) { if (bp instanceof ICBreakpoint) { boolean ok = false; diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java index 803b4b9a6..d30176e84 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2009, 2012 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; @@ -109,18 +110,38 @@ public class TCFLocalAgent { public void run() { try { final int n = prs.waitFor(); + final StringBuffer sbf = new StringBuffer(); if (n != 0) { + char cbf[] = new char[256]; + InputStreamReader r = new InputStreamReader(prs.getErrorStream()); + for (;;) { + try { + int rd = r.read(cbf); + if (rd < 0) break; + sbf.append(cbf, 0, rd); + } + catch (IOException x) { + break; + } + } + try { + r.close(); + } + catch (IOException x) { + } + sbf.append("TCF Agent exited with code "); + sbf.append(n); Protocol.invokeLater(new Runnable() { public void run() { if (waiting.isDone()) return; - waiting.error(new IOException("TCF Agent exited with code " + n)); + waiting.error(new IOException(sbf.toString())); } }); } synchronized (TCFLocalAgent.class) { if (agent == prs) { if (n != 0 && !destroed) { - Activator.log("TCF Agent exited with code " + n, null); + Activator.log(sbf.toString(), null); } agent = null; } @@ -164,6 +185,7 @@ public class TCFLocalAgent { public static synchronized String getLocalAgentID() { return new TCFTask<String>() { + int cnt; public void run() { final ILocator locator = Protocol.getLocator(); for (IPeer p : locator.getPeers().values()) { @@ -172,7 +194,12 @@ public class TCFLocalAgent { return; } } - done(null); + if (cnt++ < 10) { + Protocol.invokeLater(100, this); + } + else { + done(null); + } } }.getE(); } |