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