How to run methods during debugging without invalidating the current stack frame


When I invoke methods on the objects in a stack frame during debugging, I invalidate the stack frame and cannot call any getValue() on the stack frame objects anymore (StackFrameImpl always checks for validity using validateStackFrame() and will throw an error).

computeChildren() (see related post below), which is used by IntelliJs debugger, does not seem to invalidate the stack frame. However, I strongly believe it also calls certain methods on the debugged objects (see NodeRendererSettings:76-92).

I couldn't figure out exactly where these calls happen and why they don't invalidate the stack frame. Can you help me with finding out how that works?

I am calling methods on collection objects during debugging to visualize them in my plugin (Visual Debugger), similar to how IntelliJs does it. Doing this invalidates the stackframe and cannot analyze it further, which I want to do.

How do you manage to call methods and not invalidate the stack frame?

Thanks a lot in advance and best regards,

Tim Kräuter

Related to my previous posts: Accessing debug information.


Hi, any methods invocation invalidate everything by calling com.intellij.debugger.jdi.VirtualMachineProxyImpl#clearCaches (and increasing myTimeStamp theres). Usually to overcome this we use com.intellij.debugger.jdi.StackFrameProxyImpl instead of StackFrameImpl  directly.



Thanks for the info and the quick reply. A first test using StackeFrameProxy seems to solve my problem. Consider this question solved for now.



Works perfectly now thansk!