---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 8 Edition"
java_version: 8
chapter: "Chapter 4. The class File Format"
section: "4.7.11"
heading: "4.7.11. The SourceDebugExtension Attribute"
parent: "4.7. Attributes"
source: https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.11
id: "4.7.11"
url: https://jvm.obfuscated.software/jvms/se8/4.7.11.html
raw: https://jvm.obfuscated.software/jvms/se8/4.7.11.md
---

# 4.7.11. The `SourceDebugExtension` Attribute

The `SourceDebugExtension` attribute is an optional attribute in the `attributes` table of a `ClassFile` structure ([§4.1](4.1.md)).

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_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be a `CONSTANT_Utf8_info` structure ([§4.4.7](4.4.7.md)) representing the string "`SourceDebugExtension`".

- **attribute_length**

  The value of the `attribute_length` item indicates the length of the attribute, excluding the initial six bytes.

- **debug_extension[]**

  The `debug_extension` array 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](4.4.7.md)) with no terminating zero byte.

  Note that the `debug_extension` array may denote a string longer than that which can be represented with an instance of class `String`.
