Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-04-23 12:56:31 -0400
committereutarass2010-04-23 12:56:31 -0400
commit0fc492815768f8b29f39bb463e46819f41d15699 (patch)
treea8fec29006647f70e6e72909426d0335e62f6b61 /plugins
parent7500f7b124500acb6e80017889462702009ea5d1 (diff)
downloadorg.eclipse.tcf-0fc492815768f8b29f39bb463e46819f41d15699.tar.gz
org.eclipse.tcf-0fc492815768f8b29f39bb463e46819f41d15699.tar.xz
org.eclipse.tcf-0fc492815768f8b29f39bb463e46819f41d15699.zip
1. Extended Symbols service to provide stack tracing rules.
2. TCF Agent now can cache and use stack tracing rules that are retrieved from a symbols server.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/SymbolsProxy.java40
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IExpressions.java6
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IMemory.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IRegisters.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ISymbols.java63
5 files changed, 108 insertions, 7 deletions
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/SymbolsProxy.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/SymbolsProxy.java
index 4aa7bf4ee..c626619eb 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/SymbolsProxy.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/SymbolsProxy.java
@@ -1,6 +1,7 @@
package org.eclipse.tm.internal.tcf.services.remote;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
import org.eclipse.tm.tcf.core.Command;
@@ -197,10 +198,49 @@ public class SymbolsProxy implements ISymbols {
}.token;
}
+ public IToken findFrameInfo(String context_id, Number address, final DoneFindFrameInfo done) {
+ return new Command(channel, this, "findFrameInfo", new Object[]{ context_id, address }) {
+ @Override
+ public void done(Exception error, Object[] args) {
+ Number address = null;
+ Number size = null;
+ Object[] fp_cmds = null;
+ Map<String,Object[]> reg_cmds = null;
+ if (error == null) {
+ assert args.length == 5;
+ error = toError(args[0]);
+ address = (Number)args[1];
+ size = (Number)args[2];
+ fp_cmds = toObjectArray(args[3]);
+ reg_cmds = toStringMap(args[4]);
+ }
+ done.doneFindFrameInfo(token, error, address, size, fp_cmds, reg_cmds);
+ }
+ }.token;
+ }
+
@SuppressWarnings("unchecked")
private String[] toStringArray(Object o) {
if (o == null) return null;
Collection<String> c = (Collection<String>)o;
return (String[])c.toArray(new String[c.size()]);
}
+
+ @SuppressWarnings("unchecked")
+ private Object[] toObjectArray(Object o) {
+ if (o == null) return null;
+ Collection<Object> c = (Collection<Object>)o;
+ return (Object[])c.toArray(new Object[c.size()]);
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<String,Object[]> toStringMap(Object o) {
+ if (o == null) return null;
+ Map<String,Object> c = (Map<String,Object>)o;
+ HashMap<String,Object[]> m = new HashMap<String,Object[]>();
+ for (String id : c.keySet()) {
+ m.put(id, toObjectArray(c.get(id)));
+ }
+ return m;
+ }
}
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IExpressions.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IExpressions.java
index cfc154472..0e79189ec 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IExpressions.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IExpressions.java
@@ -126,9 +126,9 @@ public interface IExpressions extends IService {
String getTypeID();
/**
- * Check endianess of the values.
- * Big endian means decreasing numeric significance with increasing byte number.
- * @return true if big endian.
+ * Check endianness of the values.
+ * Big-endian means decreasing numeric significance with increasing byte number.
+ * @return true if big-endian.
*/
boolean isBigEndian();
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IMemory.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IMemory.java
index 38d426f4b..fed1feb12 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IMemory.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IMemory.java
@@ -145,7 +145,7 @@ public interface IMemory extends IService {
String getProcessID();
/**
- * Get memory endianess.
+ * Get memory endianness.
* @return true if memory is big-endian.
*/
boolean isBigEndian();
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IRegisters.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IRegisters.java
index 067abe521..e6d98a321 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IRegisters.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IRegisters.java
@@ -207,9 +207,9 @@ public interface IRegisters extends IService {
boolean isFloat();
/**
- * Check endianess of the context.
+ * Check endianness of the context.
* Big endian means decreasing numeric significance with increasing bit number.
- * The endianess is used to encode and decode values of get, getm, set and setm commands.
+ * The endianness is used to encode and decode values of get, getm, set and setm commands.
* @return true if big endian.
*/
boolean isBigEndian();
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ISymbols.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ISymbols.java
index fe286f51a..3a48881d3 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ISymbols.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ISymbols.java
@@ -158,7 +158,7 @@ public interface ISymbols extends IService {
byte[] getValue();
/**
- * Get symbol values endianess.
+ * Get symbol values endianness.
* @return true if symbol is big-endian.
*/
boolean isBigEndian();
@@ -275,6 +275,12 @@ public interface ISymbols extends IService {
* Client call back interface for find().
*/
interface DoneFind {
+ /**
+ * Called when symbol search is done.
+ * @param token - command handle.
+ * @param error error description if operation failed, null if succeeded.
+ * @param symbol_id - symbol ID.
+ */
void doneFind(IToken token, Exception error, String symbol_id);
}
@@ -292,6 +298,61 @@ public interface ISymbols extends IService {
* Client call back interface for list().
*/
interface DoneList {
+ /**
+ * Called when symbol list retrieval is done.
+ * @param token - command handle.
+ * @param error error description if operation failed, null if succeeded.
+ * @param symbol_ids - array of symbol IDs.
+ */
void doneList(IToken token, Exception error, String[] symbol_ids);
}
+
+ /***********************************************************************************************/
+
+ /**
+ * Command codes that used to calculate frame pointer and register values during stack tracing.
+ */
+ static final int
+ /** Load a number to the evaluation stack. Command argument is the number. */
+ CMD_NUMBER = 1,
+
+ /** Load a register value to the evaluation stack. Command argument is the register ID. */
+ CMD_REGISTER = 2,
+
+ /** Load frame address to the evaluation stack. */
+ CMD_FP = 3,
+
+ /** Read memory at address on the top of the evaluation stack. Command arguments are
+ * the value size (Number) and endianness (Boolean, false - little-endian, true - big-endian). */
+ CMD_DEREF = 4,
+
+ /** Add two values on top of the evaluation stack */
+ CMD_ADD = 5;
+
+ /**
+ * Retrieve stack tracing commands for given instruction address in a context memory.
+ * @param context_id - exacutable context ID.
+ * @param address - instruction address.
+ * @param done - call back interface called when operation is completed.
+ * @return - pending command handle.
+ */
+ IToken findFrameInfo(String context_id, Number address, DoneFindFrameInfo done);
+
+ /**
+ * Client call back interface for findFrameInfo().
+ */
+ interface DoneFindFrameInfo {
+ /**
+ * Called when stack tracing information retrieval is done.
+ * @param token - command handle.
+ * @param error error description if operation failed, null if succeeded.
+ * @param address - start of instruction address range
+ * @param size - size of instruction address range
+ * @param fp_cmds - commands to calculate stack frame pointer
+ * @param reg_cmds - map register IDs -> commands to calculate register values
+ */
+ void doneFindFrameInfo(IToken token, Exception error,
+ Number address, Number size,
+ Object[] fp_cmds, Map<String,Object[]> reg_cmds);
+ }
}

Back to the top