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

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

  •  23-06-2022
  •  | 
  •  

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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top