The SourceDebugExtension attribute is an optional attribute in the attributes table of a ClassFile structure (§4.1).
There may be at most one SourceDebugExtension attribute in the attributes table of a ClassFile structure.
The SourceDebugExtension attribute has the following format:
SourceDebugExtension_attribute {
u2 attribute_name_index;
u4 attribute_length;
u1 debug_extension[attribute_length];
}
The items of the SourceDebugExtension_attribute structure are as follows:
-
attribute_name_index
The value of the
attribute_name_indexitem must be a valid index into theconstant_pooltable. Theconstant_poolentry at that index must be aCONSTANT_Utf8_infostructure (§4.4.7) representing the string "SourceDebugExtension". -
attribute_length
The value of the
attribute_lengthitem indicates the length of the attribute, excluding the initial six bytes. -
debug_extension[]
The
debug_extensionarray holds extended debugging information which has no semantic effect on the Java Virtual Machine. The information is represented using a modified UTF-8 string (§4.4.7) with no terminating zero byte.Note that the
debug_extensionarray may denote a string longer than that which can be represented with an instance of classString.