Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-09-04 23:51:29 +0000
committereutarass2008-09-04 23:51:29 +0000
commit5ba285d9ccccec48c35297edf5463a3e256ebc60 (patch)
tree5580a765312defbf08fdb7017b8a10b90b91fe70
parent9e6d6b25c4e2bd91dca1f18d6cc95b88d95aaf71 (diff)
downloadorg.eclipse.tcf-5ba285d9ccccec48c35297edf5463a3e256ebc60.tar.gz
org.eclipse.tcf-5ba285d9ccccec48c35297edf5463a3e256ebc60.tar.xz
org.eclipse.tcf-5ba285d9ccccec48c35297edf5463a3e256ebc60.zip
TCF Agent: improved handling of debug info, including DWARF location expressions support, etc.
Debugger Variables view now properly shows local variables for both Windows and Linux DBGHELP.DLL is now searched and loaded (if available) at run-time
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java5
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/DiagnosticsService.java2
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java10
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/core/AbstractChannel.java4
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/util/TCFTask.java65
5 files changed, 46 insertions, 40 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
index decb17ec2..0483dae8a 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
@@ -190,10 +190,7 @@ class TestRCBP1 implements ITCFTest,
}
if (!test_suite.isActive(this)) return;
assert this.context_id != null;
- if (!symbol.isGlobal()) {
- exit(new Exception("Symbols 'tcf_test_*' must be global"));
- }
- else if (!symbol.isAbs()) {
+ if (!symbol.isAbs()) {
exit(new Exception("Symbols 'tcf_test_*' must be absolute"));
}
else if (symbol.getValue().longValue() == 0) {
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/DiagnosticsService.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/DiagnosticsService.java
index b14c4101b..25f6eff68 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/DiagnosticsService.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/DiagnosticsService.java
@@ -31,7 +31,7 @@ public class DiagnosticsService implements IDiagnostics {
}
else if (name.equals("getTestList")) {
channel.sendResult(token, JSON.toJSONSequence(new Object[]{
- new Integer(0), null, new String[0]}));
+ null, new String[0]}));
}
else {
channel.terminate(new Exception("Illegal command: " + name));
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
index ccc67c7f5..a1197f00d 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
@@ -24,10 +24,8 @@ import java.util.Map;
import org.eclipse.tm.internal.tcf.core.LocalPeer;
import org.eclipse.tm.internal.tcf.core.RemotePeer;
-import org.eclipse.tm.tcf.Activator;
import org.eclipse.tm.tcf.core.AbstractChannel;
import org.eclipse.tm.tcf.protocol.IChannel;
-import org.eclipse.tm.tcf.protocol.IEventQueue;
import org.eclipse.tm.tcf.protocol.IPeer;
import org.eclipse.tm.tcf.protocol.IToken;
import org.eclipse.tm.tcf.protocol.JSON;
@@ -143,17 +141,11 @@ public class LocatorService implements ILocator {
if (name.equals("redirect")) {
// String peer_id = (String)JSON.parseSequence(data)[0];
// TODO: perform local ILocator.redirect
- channel.sendResult(token, JSON.toJSONSequence(new Object[]{
- new Integer(0), null }));
+ channel.sendResult(token, JSON.toJSONSequence(new Object[]{ null }));
}
else if (name.equals("sync")) {
channel.sendResult(token, null);
}
- else if (name.equals("publishPeer")) {
- // TODO: handle "publishPeer" command from discovery master
- channel.sendResult(token, JSON.toJSONSequence(new Object[]{
- new Integer(0), null, new Integer(0) }));
- }
else {
channel.terminate(new Exception("Illegal command: " + name));
}
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/core/AbstractChannel.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/core/AbstractChannel.java
index 0418d02d5..3146b1dd9 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/core/AbstractChannel.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/core/AbstractChannel.java
@@ -718,7 +718,9 @@ public abstract class AbstractChannel implements IChannel {
}
break;
case 'F':
- remote_congestion_level = Integer.parseInt(new String(msg.data, "ASCII"));
+ int len = msg.data.length;
+ if (len > 0 && msg.data[len - 1] == 0) len--;
+ remote_congestion_level = Integer.parseInt(new String(msg.data, 0, len, "ASCII"));
break;
default:
assert false;
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/util/TCFTask.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/util/TCFTask.java
index 5e3be2a5c..e277f969c 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/util/TCFTask.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/util/TCFTask.java
@@ -11,6 +11,7 @@
package org.eclipse.tm.tcf.util;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@@ -52,8 +53,9 @@ public abstract class TCFTask<V> implements Runnable, Future<V> {
}
public synchronized void done(V result) {
- if (canceled) return;
assert Protocol.isDispatchThread();
+ assert result != null;
+ if (canceled) return;
assert this.error == null;
assert this.result == null;
this.result = result;
@@ -62,16 +64,16 @@ public abstract class TCFTask<V> implements Runnable, Future<V> {
public synchronized void error(Throwable error) {
assert Protocol.isDispatchThread();
+ assert error != null;
if (canceled) return;
assert this.error == null;
assert this.result == null;
this.error = error;
- //System.err.print("TCFTask exception: ");
- //error.printStackTrace();
notifyAll();
}
public synchronized boolean cancel(boolean mayInterruptIfRunning) {
+ assert Protocol.isDispatchThread();
if (isDone()) return false;
canceled = true;
error = new CancellationException();
@@ -79,37 +81,50 @@ public abstract class TCFTask<V> implements Runnable, Future<V> {
return true;
}
- public V get() throws InterruptedException, ExecutionException {
+ public synchronized V get() throws InterruptedException, ExecutionException {
assert !Protocol.isDispatchThread();
- synchronized (this) {
- if (!isDone()) wait();
- if (error instanceof ExecutionException) throw (ExecutionException)error;
- if (error instanceof InterruptedException) throw (InterruptedException)error;
- if (error != null) throw new ExecutionException(error);
- return result;
- }
+ while (!isDone()) wait();
+ assert error != null || result != null;
+ if (error instanceof ExecutionException) throw (ExecutionException)error;
+ if (error instanceof InterruptedException) throw (InterruptedException)error;
+ if (error != null) throw new ExecutionException(error);
+ return result;
}
- public V getE() {
- try {
- return get();
- }
- catch (Throwable e) {
- if (e instanceof Error) throw (Error)e;
- throw new Error(e);
+ public synchronized V getE() {
+ assert !Protocol.isDispatchThread();
+ while (!isDone()) {
+ try {
+ wait();
+ }
+ catch (InterruptedException x) {
+ throw new Error(x);
+ }
}
+ assert error != null || result != null;
+ if (error instanceof Error) throw (Error)error;
+ if (error != null) throw new Error(error);
+ return result;
}
- public V getIO() throws IOException {
- try {
- return get();
+ public synchronized V getIO() throws IOException {
+ assert !Protocol.isDispatchThread();
+ while (!isDone()) {
+ try {
+ wait();
+ }
+ catch (InterruptedException x) {
+ throw new InterruptedIOException();
+ }
}
- catch (Throwable e) {
- if (e instanceof IOException) throw (IOException)e;
+ assert error != null || result != null;
+ if (error instanceof IOException) throw (IOException)error;
+ if (error != null) {
IOException y = new IOException();
- y.initCause(e);
+ y.initCause(error);
throw y;
}
+ return result;
}
public synchronized V get(long timeout, TimeUnit unit)
@@ -125,6 +140,6 @@ public abstract class TCFTask<V> implements Runnable, Future<V> {
}
public synchronized boolean isDone() {
- return canceled || error != null || result != null;
+ return error != null || result != null;
}
}

Back to the top