Skip to content

debuginfo: DWARF computed/fragmented locations (stack_value + piece + arithmetic) #1706

Description

@octalide

What

Extend .debug_loclists with the computed/fragmented opcode set on top of the framing: DW_OP_stack_value (value-not-location, for constants and salvaged exprs), DW_OP_constu/consts, DW_OP_plus_uconst and arithmetic, and DW_OP_piece/DW_OP_bit_piece for variables split across multiple homes. Consumes the DCE-salvaged expressions from #1696. Shared, covers ELF + Mach-O.

Why

On optimized output a variable is often a constant, a recovered arithmetic expression, or split across a register + a slot — none expressible by reg/breg ranges alone. This is the second half of loclists, split out from the framing for PR sizing (the framing issue was too large to land as one change).

Acceptance

  • lldb shows correct values for constant-folded and register/slot-fragmented locals on an optimized -g binary, both primes; salvaged values render via DW_OP_stack_value, never garbage.
  • llvm-dwarfdump --verify clean.

Depends-on: #1705.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:codegenIR/middle-end, isel, regalloc, frame, encoders, inline asmfeaturenew capability, or an extension of an existing one

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions