SourceDebugExtension attribute
Free-form debugging text, in practice a source map (JSR 45 "SMAP") from bytecode lines back to a different source language: JSP pages, and Kotlin's inline functions..
- Appears on
- class
- Since
- class file 49.0 (Java 5)
- javac writes it
- never; other compilers use it
- Needed by the JVM
- no: it is for the class libraries (reflection), compilers or tools
Layout
| Type | Field | What it holds |
|---|---|---|
u2 | attribute_name_index | a Utf8: "SourceDebugExtension" |
u4 | attribute_length | bytes after this field |
u1[attribute_length] | debug_extension | modified UTF-8 text |
What it is for
Free-form debugging text, in practice a source map (JSR 45 "SMAP") from bytecode lines back to a different source language: JSP pages, and Kotlin's inline functions.
How common it is
None of the 7,391 classes in JDK 25.0.5's java.base has one.
Specification: JVMS §4.7, The SourceDebugExtension Attribute (Java SE 25).