-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
129 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...src/main/scala/ch/epfl/scala/debugadapter/internal/stacktrace/DecodedVariableBridge.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ch.epfl.scala.debugadapter.internal.stacktrace | ||
|
||
import ch.epfl.scala.debugadapter.internal.Errors | ||
import com.microsoft.java.debug.core.adapter.stacktrace.DecodedVariable | ||
|
||
import java.lang.reflect.InvocationTargetException | ||
|
||
class DecodedVariableBridge(instance: Any) extends DecodedVariable { | ||
|
||
override def format(): String = invoke[String]("format") | ||
|
||
private def invoke[T](variableName: String): T = | ||
try instance.getClass().getField(variableName).get(instance).asInstanceOf[T] | ||
catch { | ||
case e: InvocationTargetException => | ||
throw Errors.frameDecodingFailure(e.getCause) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...les/core/src/main/scala/ch/epfl/scala/debugadapter/internal/stacktrace/JavaVariable.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ch.epfl.scala.debugadapter.internal.stacktrace | ||
|
||
import com.sun.jdi | ||
import com.microsoft.java.debug.core.adapter.stacktrace.DecodedVariable | ||
|
||
final case class JavaVariable(variable: jdi.LocalVariable) extends DecodedVariable { | ||
def format: String = { | ||
variable.name() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...es/decoder/src/main/scala/ch/epfl/scala/debugadapter/internal/DecodedVariableBridge.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ch.epfl.scala.debugadapter.internal | ||
|
||
import ch.epfl.scala.decoder.DecodedVariable | ||
import ch.epfl.scala.decoder.StackTraceFormatter | ||
import tastyquery.Symbols.* | ||
import tastyquery.Modifiers.* | ||
import ch.epfl.scala.decoder.DecodedVariable.ValDef | ||
import ch.epfl.scala.decoder.DecodedVariable.CapturedVariable | ||
import ch.epfl.scala.decoder.DecodedVariable.This | ||
import ch.epfl.scala.decoder.DecodedVariable.AnyValThis | ||
|
||
class DecodedVariableBridge(variable: DecodedVariable): | ||
def format: String = variable match | ||
case v: ValDef => v.symbol.name.toString | ||
case v: CapturedVariable => v.symbol.name.toString | ||
case v: This => "this" | ||
case v: AnyValThis => v.symbol.name.toString | ||
|
||
// formatter.format(variable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule java-debug
updated
5 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters