diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java index 10063701ca9..11202600730 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java @@ -901,7 +901,9 @@ public class MIStack extends AbstractDsfService // still be re-used. StackDepthInfo cachedDepth = fStackDepthCache.get(execDmc.getThreadId()); if (cachedDepth != null) { - if (cachedDepth.maxDepthRequested == 0 || cachedDepth.maxDepthRequested >= maxDepth) { + if ((maxDepth == 0 && cachedDepth.maxDepthRequested == 0) || + (maxDepth != 0 && (cachedDepth.maxDepthRequested == 0 || cachedDepth.maxDepthRequested >= maxDepth)) ) + { rm.setData(cachedDepth.returnedDepth); rm.done(); return;