Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2014-07-23 11:22:33 -0400
committerAnton Leherbauer2014-07-23 11:42:16 -0400
commitcec539106cc80f6e5b8b8963da82921940bba55f (patch)
tree1c71ccfeee929621270caff44141c99b71b472fd
parent9e97c888255f5d7a2436c1e5469ae708833a48f7 (diff)
downloadorg.eclipse.tcf-cec539106cc80f6e5b8b8963da82921940bba55f.tar.gz
org.eclipse.tcf-cec539106cc80f6e5b8b8963da82921940bba55f.tar.xz
org.eclipse.tcf-cec539106cc80f6e5b8b8963da82921940bba55f.zip
Bug 439761 - Java SymbolsProxy does not accept list of contexts as response from findByAddr
- fixed ClassCastException if a list of contexts is returned - added new API to retrieve all symbol matches of findByAddr command Change-Id: Iff82437d59923def9e88a01c37625ee993e7e186 Signed-off-by: Anton Leherbauer <anton.leherbauer@windriver.com>
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java21
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java18
2 files changed, 36 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
index 90d3d9815..9970c6582 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
@@ -248,19 +248,38 @@ public class SymbolsProxy implements ISymbols {
public IToken findByAddr(String context_id, Number addr, final DoneFind done) {
return new Command(channel, this, "findByAddr", new Object[]{ context_id, addr }) {
+ @SuppressWarnings("rawtypes")
@Override
public void done(Exception error, Object[] args) {
String id = null;
if (error == null) {
assert args.length == 2;
error = toError(args[0]);
- id = (String)args[1];
+ if (args[1] instanceof Collection)
+ id = (String)((Collection) args[1]).iterator().next();
+ else
+ id = (String)args[1];
}
done.doneFind(token, error, id);
}
}.token;
}
+ public IToken findByAddr(String context_id, Number addr, final DoneFindAll done) {
+ return new Command(channel, this, "findByAddr", new Object[]{ context_id, addr }) {
+ @Override
+ public void done(Exception error, Object[] args) {
+ String[] ids = null;
+ if (error == null) {
+ assert args.length == 2;
+ error = toError(args[0]);
+ ids = toStringArray(args[1]);
+ }
+ done.doneFind(token, error, ids);
+ }
+ }.token;
+ }
+
public IToken list(String context_id, final DoneList done) {
return new Command(channel, this, "list", new Object[]{ context_id }) {
@Override
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
index 0ff765a4a..63f89f352 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
@@ -355,6 +355,7 @@ public interface ISymbols extends IService {
/**
* Search symbol with given address in given context.
+ * Return first matching symbol.
* The context can be memory space, process, thread or stack frame.
*
* @param context_id - a search scope.
@@ -366,6 +367,19 @@ public interface ISymbols extends IService {
/**
* Search symbol with given address in given context.
+ * Return all matching symbols.
+ * The context can be memory space, process, thread or stack frame.
+ *
+ * @param context_id - a search scope.
+ * @param addr - symbol address.
+ * @param done - call back interface called when operation is completed.
+ * @return - pending command handle.
+ * @since 1.3
+ */
+ IToken findByAddr(String context_id, Number addr, DoneFindAll done);
+
+ /**
+ * Search symbol with given address in given context.
* The context can be memory space, process, thread or stack frame.
*
* @param context_id - a search scope.
@@ -378,7 +392,7 @@ public interface ISymbols extends IService {
IToken findInScope(String context_id, Number ip, String scope_id, String name, DoneFindAll done);
/**
- * Client call back interface for find()and findByAddr().
+ * Client call back interface for find() and findByAddr().
*/
interface DoneFind {
/**
@@ -391,7 +405,7 @@ public interface ISymbols extends IService {
}
/**
- * Client call back interface for findByName() and findInScope().
+ * Client call back interface for findByName(), findInScope() and findByAddr().
*/
interface DoneFindAll {
/**

Back to the top