Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

It looks like stepping through lambda bodies in Java 8 is possibleis possible. But does anyone know how it can be done in JDI?

It looks like stepping through lambda bodies in Java 8 is possible. But does anyone know how it can be done in JDI?

It looks like stepping through lambda bodies in Java 8 is possible. But does anyone know how it can be done in JDI?

edited title
Link
daveagp
  • 2.7k
  • 2
  • 21
  • 21

Java Debug Interface and, Lambdas and Line Numbers

added 183 characters in body
Source Link
daveagp
  • 2.7k
  • 2
  • 21
  • 21
  • when .allLineLocations is called on the Lam class, it does reflect all of these line numbers.
  • when a JDI Event happens within the lambda class (e.g. from stepping), the .sourceName() of the location throws an AbsentInformationException
  • it looks like jdk.internal.org.objectweb.asm.* is doing a bunch of stuff related to copying the lambda
  • I'm not sure if the map from source lines to bytecodes is kept in Java, or in the JDI

So my working hypothesis is that when the lambda's class is created at runtime, the JDI needs to do something to recognize that the new class's bytecode is coming from the old class's bytecode (which is in turn coming from from Lam.java). I don't know enough about the internal representation of java.lang.Class or com.sun.jdi.ClassType to know where to begin.

  • when .allLineLocations is called on the Lam class, it does reflect all of these line numbers.
  • when a JDI Event happens within the lambda class (e.g. from stepping), the .sourceName() of the location throws an AbsentInformationException

So my working hypothesis is that when the lambda's class is created at runtime, the JDI needs to do something to recognize that the new class's bytecode is coming from Lam.java.

  • when .allLineLocations is called on the Lam class, it does reflect all of these line numbers.
  • when a JDI Event happens within the lambda class (e.g. from stepping), the .sourceName() of the location throws an AbsentInformationException
  • it looks like jdk.internal.org.objectweb.asm.* is doing a bunch of stuff related to copying the lambda
  • I'm not sure if the map from source lines to bytecodes is kept in Java, or in the JDI

So my working hypothesis is that when the lambda's class is created at runtime, the JDI needs to do something to recognize that the new class's bytecode is coming from the old class's bytecode (which is in turn coming from from Lam.java). I don't know enough about the internal representation of java.lang.Class or com.sun.jdi.ClassType to know where to begin.

added 611 characters in body
Source Link
daveagp
  • 2.7k
  • 2
  • 21
  • 21
Loading
Source Link
daveagp
  • 2.7k
  • 2
  • 21
  • 21
Loading