Accessing the debug information (variables) while debugging with a plugin (Intellij)
Answered
Hi,
I was wondering if it is possible to access the debug information during a debugging session and show additional information in an IntelliJ plugin. I want to visualize the debugging process. I am looking for an API with the following capabilities:
- Get the variables in the debug window, when a debug session is started.
- Get the changes to the variables when the user steps forward while debugging.
Thanks in advance for any help and information!
Please sign in to leave a comment.
Can anyone help?
Sorry for delay, answer is being prepared.
Hi, you can start with
it will return an instance of the current XDebugSession. Then
and computeChildren on the result will calculate the variables. Changes you'll have to compute yourself. A listener for
will trigger on every debugger stop.
Thank you very much! I will try it out this weekend!
Thanks for the detailed information. It is working quite well for me!
There is one thing I was wondering about regarding the values of the objects in the XStackFrame.
How can I get the values of the fields of the objects? For example, if I have an object with a name field of type string. How can I read this value or in general the values of all fields?
With computeChildren() I obtain a XValueChildrenList. There I was looking through the attribute myValues and each particular XValue but I was not able to find the value for the fields yet. Maybe you can give me a tip.
Thanks in advance!
I nearly found the solution but I came up with a new question:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010630039-How-to-get-the-type-and-value-of-a-debugging-variable-XValue-