Error when reading debugging variables during a debugging session with a plugin

Answered

This is related to my previous post:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010503200-Accessing-the-debug-information-variables-while-debugging-with-a-plugin-Intellij-
I am trying to read the values during a debugging session with my plugin.
I am calling computeChildren() recursively on the XStackFrame I got from the running debugging session.

However, when I have an object which contains a collection such as a list a get an error (see stack trace below).

I think the error is created by the scheduled command in com.intellij.debugger.engine.JavaValue#computeChildren():295. However, I am not able to call calcValue() on the object because it is a child object which I only would have access to after computeChildren() has finished.

I have created a sample project to show the error I am running into on GitHub: https://github.com/timKraeuter/SampleDebugError/tree/master

I hope someone can point out where I went wrong! Thanks in advance!

Error:

java.lang.Throwable: Value is not yet calculated for class com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl.assertValueReady(ValueDescriptorImpl.java:97)
at com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl.getValue(ValueDescriptorImpl.java:191)
at com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl.getRenderer(ValueDescriptorImpl.java:521)
at com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl.getChildrenRenderer(ValueDescriptorImpl.java:516)
at com.intellij.debugger.engine.JavaValue$2.contextAction(JavaValue.java:293)
at com.intellij.debugger.engine.JavaValue$3.contextAction(JavaValue.java:400)
at com.intellij.debugger.engine.events.SuspendContextCommandImpl.action(SuspendContextCommandImpl.java:59)
at com.intellij.debugger.engine.events.DebuggerCommandImpl.run(DebuggerCommandImpl.java:43)
at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:154)
at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:29)
at com.intellij.debugger.impl.InvokeThread.lambda$run$0(InvokeThread.java:138)
at com.intellij.openapi.project.DumbService.runWithAlternativeResolveEnabled(DumbService.java:369)
at com.intellij.debugger.impl.InvokeThread.run(InvokeThread.java:125)
at com.intellij.debugger.impl.InvokeThread$WorkerThreadRequest.lambda$run$0(InvokeThread.java:49)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.debugger.impl.InvokeThread$WorkerThreadRequest.run(InvokeThread.java:48)
0
2 comments

Hi, it seems that JavaValue does not follow the api correctly, please call computePresentation before computeChildren for it to work.

1

That works perfectly. Thanks!

0

Please sign in to leave a comment.