Issue 250118.1: DW_AT_discr_value improvement

Author: Tom Tromey
Champion:
Date submitted: 2025-01-18
Date revised: 2025-01-29
Date closed: 2025-02-03
Type: Improvement
Status: Accepted
DWARF version: 6

Background

This comes from a Rust bug.

Problem

DW_AT_discr_value (section 5.7 page 123) says:

The variant entry may have a DW_AT_discr_value attribute whose value represents the discriminant value selecting this variant. The value of this attribute is encoded as an LEB128 number.

It is needless and confusing to specify LEB128 here, as the form will determine the representation. Additionally there doesn't seem to be any reason to limit the forms that may be used here.

Proposal

(a) Remove the sentence "The value of this attribute is encoded as an LEB128 number."

(b) Change the sentence to "The value of this attribute is encoded as a value of class constant."


2025-02-03: Accepted proposal (a). Will remove the sentence.