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

TypeFieldWhat it holds
u2attribute_name_indexa Utf8: "SourceDebugExtension"
u4attribute_lengthbytes after this field
u1[attribute_length]debug_extensionmodified 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).