Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-09-06 12:47:39 -0400
committerPawel Piech2012-09-06 12:50:37 -0400
commite8fcc2fc795e72b3fab92528a0156851e62c28da (patch)
treeef395576a492808558eb19949cdb03aab6e2a0b3
parent3e9fde6d2f51211801286a632021bd96e107ad35 (diff)
downloadorg.eclipse.tcf-e8fcc2fc795e72b3fab92528a0156851e62c28da.tar.gz
org.eclipse.tcf-e8fcc2fc795e72b3fab92528a0156851e62c28da.tar.xz
org.eclipse.tcf-e8fcc2fc795e72b3fab92528a0156851e62c28da.zip
Bug 388973 - Guard against ISymbols.Symbol.getAddress() returning null.
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java5
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeStackFrame.java4
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
index 9ad29c07c..7329fb1fb 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
@@ -571,7 +571,9 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
public void doneGetContext(IToken token, Exception error, ISymbols.Symbol context) {
BigInteger nextAddress = null;
if (error == null && context != null) {
- if (context.getTypeClass().equals(ISymbols.TypeClass.function)) {
+ if (context.getTypeClass().equals(ISymbols.TypeClass.function) &&
+ context.getAddress() != null && context.getSize() >= 0)
+ {
symbolList.add(context);
nextAddress = JSON.toBigInteger(context.getAddress()).add(BigInteger.valueOf(context.getSize()));
}
@@ -754,6 +756,7 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
private FunctionOffset getFunctionOffset(BigInteger address, ISymbols.Symbol[] symbols) {
if (symbols != null) {
for (ISymbols.Symbol symbol : symbols) {
+ if (symbol.getAddress() == null) continue;
BigInteger symbolAddress = JSON.toBigInteger(symbol.getAddress());
BigInteger offset = address.subtract(symbolAddress);
switch (offset.compareTo(BigInteger.ZERO)) {
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeStackFrame.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeStackFrame.java
index f72524b5c..da38d87c7 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeStackFrame.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeStackFrame.java
@@ -107,7 +107,9 @@ public class TCFNodeStackFrame extends TCFNode {
TCFDataCache<ISymbols.Symbol> sym_cache = model.getSymbolInfoCache(ref.symbol_id);
if (!sym_cache.validate(this)) return false;
ISymbols.Symbol sym_data = sym_cache.getData();
- if (sym_data != null) func_start = n.equals(JSON.toBigInteger(sym_data.getAddress()));
+ if (sym_data != null && sym_data.getAddress() != null) {
+ func_start = n.equals(JSON.toBigInteger(sym_data.getAddress()));
+ }
}
if (!func_start) n = n.subtract(BigInteger.valueOf(1));
}

Back to the top