Unable to see some local variables in the debugger inside intellij for some scala programs

As described in the header, there are some cases where Intellij cannot recognize / display some local variables.

enter image description here

As you can see, some local variables, for example, outarr and arrptr, are already set: but the debugger does not know about them.

I run inside IJ 13.1.4 in a maven project and include debugging information as follows:

<configuration> <args> .. <arg>-feature</arg> <arg>-g:notc</arg> </args> .. 

My question is: did anyone recognize this problem and come up with workarounds for it?

Update . To the suggestion about the answer, here is the result of the Alt-F8 attempt

enter image description here

+5
source share
4 answers

You can try Alt + F8 to jump into the expression evaluator, usually from this window I can reach all the variables reachable from the breakpoint.

+1
source

This is mainly because debugging anonymous functions is inherently hard work!

What you can do is try to open the $outer section in variables in the debugger, which means an anonymous function containing the current context.

Repeating this (again find $outer this $outer ), you can find your variables.

enter image description here

If $outer not available, simply go to the previous stack stack by clicking on it in the Frames tab in the debugger.

+1
source

I had a similar problem in IJ 2017: I declared and initialized two local booleans, but only the second was displayed in the debugger.

Alt F8 allowed me to evaluate the expression used to initialize this Boolean, but also did not find the value of the Boolean itself.

By slightly changing the expression, comparing the result with true , before assigning it, he launched it. Therefore, in your case, there may be another initialization.

+1
source

It seems to be a jdk error, use jdk8 instead. Problems will be resolved. More: The debugger does not see the local variable in lambda

0
source

Source: https://habr.com/ru/post/1205410/


All Articles