What kind of values might the debug parameter of visitSource in ASM ClassVisitor receive?

StackOverflow https://stackoverflow.com/questions/18083436

  •  23-06-2022
  •  | 
  •  

Domanda

The visitCode method in asm's ClassVisitor accepts a debug parameter typed as a String

public final void visitSource(final String file, final String debug)

According to the JavaDoc

debug - additional debug information to compute the correspondance between source and compiled elements of the class. May be null.

I don't believe I've ever seen this populated with a value apart from null.

Under what circustances will this value be populated?

What does the data it contains look like?

È stato utile?

Soluzione

The debug value goes into the SourceDebugExtension class file attribute. You can find a complete description of its contents in JSR-045.

Usually it is used to support debugging non-Java source code compiled into Java classes, for example - JSPs. If I am not mistaken, JRuby also populating it when generating Java classes.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top