Reputation: 63042
As described in the title there are some cases that Intellij is not able to recognized/display some of the local variables.
As can be seen, some of the local variables e.g. outarr and arrptr are already set: but the debugger does not know about them.
I am running inside IJ 13.1.4 in a maven project and have enabled debugging info as follows:
<configuration>
<args>
..
<arg>-feature</arg>
<arg>-g:notc</arg>
</args>
..
My question is about : does anyone recognize this problem and has come up with workaround(s) for it?
Update Per suggestion on an answer here is the result of trying Alt-F8
Upvotes: 8
Views: 16749
Reputation: 163
this
in variables, and you can see the valuedef singlePassMultiFilter[T](
rdd: RDD[T],
f1: T => Boolean,
f2: T => Boolean,
level: StorageLevel = StorageLevel.MEMORY_ONLY
): (RDD[T], RDD[T], Boolean => Unit) = {
val tempRDD = rdd mapPartitions { iter =>
val abuf1 = ArrayBuffer.empty[T]
val abuf2 = ArrayBuffer.empty[T]
for (x <- iter) {
if (f1(x)) abuf1 += x
if (f2(x)) abuf2 += x
}
Iterator.single((abuf1, abuf2))
}
tempRDD.persist(level)
val rdd1 = tempRDD.flatMap(_._1)
val rdd2 = tempRDD.flatMap(_._2)
(rdd1, rdd2, (blocking: Boolean) => tempRDD.unpersist(blocking))
}
Upvotes: 0
Reputation: 6156
I had a similar problem in IJ 2017: I declared and initialized two local booleans, but only the second one was displayed in the debugger.
AltF8 allowed me to evaluate the expression used to initialize that boolean but did not find the value of the boolean itself either.
Changing the expression slightly by comparing the result to true
before assigning it made it work. So in your case, maybe varying the initialisation might work too.
Upvotes: 1
Reputation: 1
It seem's jdk's bug, use jdk8 instead ,problems will resolves.For more info see: Debugger cannot see local variable in a Lambda
Upvotes: 0
Reputation: 4300
This is mainly because debugging anonymous functions is inherently a hard job!
What you can do is to try to open $outer
in variables
section in debugger which means the anonymous function containing current context.
By doing this repeatedly (find $outer
of that $outer
again) there is a good chance you can find your variables.
If $outer
is not available just navigate to the previous stack frame by clicking on it on Frames
tab in Debugger.
Upvotes: 3
Reputation: 9734
You can try Alt+F8 to jump into expression evaluator, usually from that window I can reach all variables that are reachable from breakpoint.
Upvotes: 1