Variables view in debugger doesn't show values
When debugging, the variables view doesn't show the values of variables. Clicking a variable shows the following exception in the value window:
exception while invoking toString(): null
scala.tools.eclipse.debug.model.ScalaObjectReference.jdiInvokeMethod(ScalaValue.scala:172)
scala.tools.eclipse.debug.model.HasMethodInvocation$$anonfun$invokeMethod$2.apply(ScalaDebugElement.scala:141)
scala.tools.eclipse.debug.model.HasMethodInvocation$$anonfun$invokeMethod$2.apply(ScalaDebugElement.scala:135)
scala.util.control.Exception$Catch.apply(Exception.scala:102)
scala.tools.eclipse.debug.model.HasMethodInvocation$class.invokeMethod(ScalaDebugElement.scala:135)
scala.tools.eclipse.debug.model.ScalaObjectReference.invokeMethod(ScalaValue.scala:137)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$.computeDetail(ScalaDebugModelPresentation.scala:55)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$.computeDetail(ScalaDebugModelPresentation.scala:31)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$$anon$1.run(ScalaDebugModelPresentation.scala:88)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Also, can't change the value of variables - the "change value" option in the right click menu is disabled.
About your second question, "change value" is not yet supported by the Scala Debugger. I've created a ticket #1001587 (star the ticket if you want to follow progress on that).
exception while invoking toString(): null
scala.tools.eclipse.debug.model.ScalaObjectReference.jdiInvokeMethod(ScalaValue.scala:172)
scala.tools.eclipse.debug.model.HasMethodInvocation$$anonfun$invokeMethod$2.apply(ScalaDebugElement.scala:141)
scala.tools.eclipse.debug.model.HasMethodInvocation$$anonfun$invokeMethod$2.apply(ScalaDebugElement.scala:135)
scala.util.control.Exception$Catch.apply(Exception.scala:102)
scala.tools.eclipse.debug.model.HasMethodInvocation$class.invokeMethod(ScalaDebugElement.scala:135)
scala.tools.eclipse.debug.model.ScalaObjectReference.invokeMethod(ScalaValue.scala:137)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$.computeDetail(ScalaDebugModelPresentation.scala:55)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$.computeDetail(ScalaDebugModelPresentation.scala:31)
scala.tools.eclipse.debug.model.ScalaDebugModelPresentation$$anon$1.run(ScalaDebugModelPresentation.scala:88)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
plugin details: Scala IDE for Eclipse 3.0.0.nightly-2_10-201303120433-326daaf org.scala-ide.sdt.feature.feature.group scala-ide.org
Unfortunately, the way we keep track of the currently selected thread in the
Scala debugger isn't robust enough. Currently, we rely on a selectionChanged
event to be sent when the Debug Perspective is opened. This worked fine with
Eclipse Indigo, but it's no longer working with Eclipse Juno.
The workaround is to look for the first suspended thread if
``ScalaDebugger.currentThread`` is null. This is far from being a proper fix,
but it doesn't look like we have many alternatives. The Java debugger
implementation seem to be using a DebugContextProvider/Manager/Event/Listener
to know the thread associated to each variable. But using the debug context
classes would require some import work, so it would be preferable to delay this
for after the 3.0.0 final release.
The workaround was suggested by @skyluc, and he believes the only issue this
could lead to is visibility issues due to invoking a method call on the wrong
thread (in case more than one is suspended), and hence the executing thread may
see some stale values. Not an issue to be taken lightly.
Fix #1001585
backport to release/3.0.x
Branch: master
Unfortunately, the way we keep track of the currently selected thread in the
Scala debugger isn't robust enough. Currently, we rely on a selectionChanged
event to be sent when the Debug Perspective is opened. This worked fine with
Eclipse Indigo, but it's no longer working with Eclipse Juno.
The workaround is to look for the first suspended thread if
``ScalaDebugger.currentThread`` is null. This is far from being a proper fix,
but it doesn't look like we have many alternatives. The Java debugger
implementation seem to be using a DebugContextProvider/Manager/Event/Listener
to know the thread associated to each variable. But using the debug context
classes would require some import work, so it would be preferable to delay this
for after the 3.0.0 final release.
The workaround was suggested by @skyluc, and he believes the only issue this
could lead to is visibility issues due to invoking a method call on the wrong
thread (in case more than one is suspended), and hence the executing thread may
see some stale values. Not an issue to be taken lightly.
Fix #1001585
backport to release/3.0.x
(cherry picked from commit 2de89febce7f9fb36820838b83f9ebd05fb0409d)
Branch: release/scala-ide-3.0.x
Unfortunately, the way we keep track of the currently selected thread in the
Scala debugger isn't robust enough. Currently, we rely on a selectionChanged
event to be sent when the Debug Perspective is opened. This worked fine with
Eclipse Indigo, but it's no longer working with Eclipse Juno.
The workaround is to look for the first suspended thread if
``ScalaDebugger.currentThread`` is null. This is far from being a proper fix,
but it doesn't look like we have many alternatives. The Java debugger
implementation seem to be using a DebugContextProvider/Manager/Event/Listener
to know the thread associated to each variable. But using the debug context
classes would require some import work, so it would be preferable to delay this
for after the 3.0.0 final release.
The workaround was suggested by @skyluc, and he believes the only issue this
could lead to is visibility issues due to invoking a method call on the wrong
thread (in case more than one is suspended), and hence the executing thread may
see some stale values. Not an issue to be taken lightly.
Fix #1001585
backport to release/3.0.x
Branch: platform/juno
In scala-ide:2deb50b0160d8e0b21a32ba76ff7eda9d35b9238 Uses new debug view selection support
In Eclipse 4.x, a new way to follow the current selection in the debug view was implemented,
as debug specific support.
The old way was slightly broken, and was no more working for selection changes not triggered
by the user. A temporary fix was implemented in Scala 3.0.x, to support Eclipse 3.x and 4.x.
This commit replace the old code and the fix by a solution using the new support.
Fixes #1001585
Need to be backported in 3.0.x-juno.
In scala-ide:262e2d961cf6790ac9e33721335da4e7333b8b86 Uses new debug view selection support
In Eclipse 4.x, a new way to follow the current selection in the debug view was implemented,
as debug specific support.
The old way was slightly broken, and was no more working for selection changes not triggered
by the user. A temporary fix was implemented in Scala 3.0.x, to support Eclipse 3.x and 4.x.
This commit replace the old code and the fix by a solution using the new support.
Fixes #1001585
(cherry picked from commit 22238324758784a8bc9cdb1db6ce5f134b3420c3)