How to inspect the variables of the current stack frame

I am developing a debugging plugin for a project. All the cache data is serialized as a big memory block. When the debugger meets a breakpoint, the user click a button, then the plugin will deserialize the 'this' variable of the current stack frame, finally show the result as a tree.

However, I found poor documentation and relevant information about debugger API of IntelliJ IDEA plugin development. This is what I achieve for now:

Project project = e.getProject();
if (project == null) {
return;
}

XDebuggerManager manager = XDebuggerManager.getInstance(project);
XDebugSession session = manager.getCurrentSession();
if (session == null) {
return;
}

XStackFrame frame = session.getCurrentStackFrame();
if (frame == null) {
return;
}

JavaStackFrame javaFrame = (JavaStackFrame) frame;
try {
List<LocalVariableProxyImpl> variables = javaFrame.getStackFrameProxy().visibleVariables();
// TODO
} catch (EvaluateException e1) {
e1.printStackTrace();
}

I guess this is the proxy of local variables. Is it possible to inspect member variables and call member methods of a specific variable?

0

Please sign in to leave a comment.