Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-05-03 00:44:46 +0000
committereutarass2008-05-03 00:44:46 +0000
commita9183acf706be3c4a0f41a5572382acf9d0f0e28 (patch)
tree4f457b5620074c3344cf18aedc1adb433849d8b8 /plugins/org.eclipse.tm.tcf.debug
parentfeb497a50df2b2edc4a139fb52e39b394fbf05e1 (diff)
downloadorg.eclipse.tcf-a9183acf706be3c4a0f41a5572382acf9d0f0e28.tar.gz
org.eclipse.tcf-a9183acf706be3c4a0f41a5572382acf9d0f0e28.tar.xz
org.eclipse.tcf-a9183acf706be3c4a0f41a5572382acf9d0f0e28.zip
1. Bug 225555: [tcf] Migrate to DSF 1.0M6
2. Since DSF 1.0 requires it, migrated to Eclipse 3.4M6 and CDT 5.0M6 3. Since DSF is not fast enough to keep up with rapid target state changes when TCF diagnostic is running, reworked TCF flow control logic and added TCF API for client congestion monitoring, which is used to monitor DSF UI event queue.
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java16
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java97
2 files changed, 64 insertions, 49 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
index 7993267f4..00ae04f60 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
@@ -324,11 +324,11 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
m.put(IMarker.MESSAGE, "Breakpoint: " + msg);
Number line = (Number)p.get(IBreakpoints.PROP_LINE);
if (line != null) {
- m.put(IMarker.LINE_NUMBER, Integer.toString(line.intValue() + 1));
+ m.put(IMarker.LINE_NUMBER, new Integer(line.intValue() + 1));
Number column = (Number)p.get(IBreakpoints.PROP_COLUMN);
if (column != null) {
- m.put(IMarker.CHAR_START, column.toString());
- m.put(IMarker.CHAR_END, Integer.toString(column.intValue() + 1));
+ m.put(IMarker.CHAR_START, new Integer(column.intValue()));
+ m.put(IMarker.CHAR_END, new Integer(column.intValue() + 1));
}
}
return m;
@@ -350,13 +350,11 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
}
if (file != null) {
m.put(IBreakpoints.PROP_FILE, file);
- String line = (String)p.get(IMarker.LINE_NUMBER);
+ Integer line = (Integer)p.get(IMarker.LINE_NUMBER);
if (line != null) {
- m.put(IBreakpoints.PROP_LINE, new Integer(Integer.parseInt(line) - 1));
- String column = (String)p.get(IMarker.CHAR_START);
- if (column != null) {
- m.put(IBreakpoints.PROP_COLUMN, new Integer(column));
- }
+ m.put(IBreakpoints.PROP_LINE, new Integer(line.intValue() - 1));
+ Integer column = (Integer)p.get(IMarker.CHAR_START);
+ if (column != null) m.put(IBreakpoints.PROP_COLUMN, column);
}
}
return m;
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
index 6bacd0c49..7bee2287c 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
@@ -60,6 +60,8 @@ public class TCFLaunch extends Launch {
private TCFBreakpointsStatus breakpoints_status;
private String mode;
private boolean connecting;
+ private boolean disconnected;
+ private boolean shutdown;
private ProcessContext process;
public TCFLaunch(ILaunchConfiguration launchConfiguration, String mode) {
@@ -67,6 +69,7 @@ public class TCFLaunch extends Launch {
}
private void onConnected() {
+ // The method is called when TCF channel is successfully connected.
try {
final Runnable done = new Runnable() {
public void run() {
@@ -93,6 +96,58 @@ public class TCFLaunch extends Launch {
}
}
+ private void onDisconnected(Throwable error) {
+ // The method is called when TCF channel is closed.
+ assert !disconnected;
+ assert !shutdown;
+ this.error = error;
+ breakpoints_status = null;
+ connecting = false;
+ disconnected = true;
+ for (Iterator<Listener> i = listeners.iterator(); i.hasNext();) {
+ i.next().onDisconnected(this);
+ }
+ if (error != null) setError(error);
+ else fireChanged();
+ runShutdownSequence(new Runnable() {
+ public void run() {
+ shutdown = true;
+ if (DebugPlugin.getDefault() != null) fireTerminate();
+ }
+ });
+ }
+
+ private String[] toArgsArray(String file, String cmd) {
+ // Create arguments list from a command line.
+ int i = 0;
+ int l = cmd.length();
+ List<String> arr = new ArrayList<String>();
+ arr.add(file);
+ for (;;) {
+ while (i < l && cmd.charAt(i) == ' ') i++;
+ if (i >= l) break;
+ String s = null;
+ if (cmd.charAt(i) == '"') {
+ i++;
+ StringBuffer bf = new StringBuffer();
+ while (i < l) {
+ char ch = cmd.charAt(i++);
+ if (ch == '"') break;
+ if (ch == '\\' && i < l) ch = cmd.charAt(i++);
+ bf.append(ch);
+ }
+ s = bf.toString();
+ }
+ else {
+ int i0 = i;
+ while (i < l && cmd.charAt(i) != ' ') i++;
+ s = cmd.substring(i0, i);
+ }
+ arr.add(s);
+ }
+ return arr.toArray(new String[arr.size()]);
+ }
+
@SuppressWarnings("unchecked")
protected void runLaunchSequence(final Runnable done) {
try {
@@ -138,48 +193,10 @@ public class TCFLaunch extends Launch {
}
}
- private String[] toArgsArray(String file, String cmd) {
- int i = 0;
- int l = cmd.length();
- List<String> arr = new ArrayList<String>();
- arr.add(file);
- for (;;) {
- while (i < l && cmd.charAt(i) == ' ') i++;
- if (i >= l) break;
- String s = null;
- if (cmd.charAt(i) == '"') {
- i++;
- StringBuffer bf = new StringBuffer();
- while (i < l) {
- char ch = cmd.charAt(i++);
- if (ch == '"') break;
- if (ch == '\\' && i < l) ch = cmd.charAt(i++);
- bf.append(ch);
- }
- s = bf.toString();
- }
- else {
- int i0 = i;
- while (i < l && cmd.charAt(i) != ' ') i++;
- s = cmd.substring(i0, i);
- }
- arr.add(s);
- }
- return arr.toArray(new String[arr.size()]);
+ protected void runShutdownSequence(final Runnable done) {
+ done.run();
}
- private void onDisconnected(Throwable error) {
- this.error = error;
- breakpoints_status = null;
- connecting = false;
- for (Iterator<Listener> i = listeners.iterator(); i.hasNext();) {
- i.next().onDisconnected(this);
- }
- if (error != null) setError(error);
- else fireChanged();
- if (DebugPlugin.getDefault() != null) fireTerminate();
- }
-
/*--------------------------------------------------------------------------------------------*/
public Throwable getError() {

Back to the top