Skip to content

[LLDB] DWARFASTParserClang handles DW_AT_variant incorrectly #177812

@Walnut356

Description

@Walnut356

This problem affects Rust most directly. In short, there are 2 problems:

  1. LLDB stores discriminant values of DW_TAG_variant as a uint32_t, even though discriminants can be up to 128 bits long (e.g. Option<String> is 64 bits, Option<NonZero<u128>> is 128 bits). In the 128-bit case, the DW_AT_discr_value is a DW_FORM_block1:
Image
  1. die.GetAttributeValueAsOptionalUnsigned returns a std_optional<uint64_t>, so even if the DW_FORM_block1 was read correctly and VariantMember.discr_value was a u128, it wouldn't be communicated to VariantMember correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions