A Java class file format supports an attribute called "source debug extension" (see Java language specification ยง4.7.11 "TheSourceDebugExtension
attribute").
In JVMs that support this aspect of JVMTI, you can query for this string using jvmtiError GetSourceDebugExtension(jvmtiEnv *, jclass, char **)
.
My question is whether there's a way to use ordinary javac
and the Java language to embed "source debug extension" information in a .class
file. There doesn't appear to be an annotation in the core Java language that would do this (no obvious candidates in the "All Known Implementing Classes" list in the javadoc for java.lang.Annotation
).