Files
Tom Tromey e96af290ed Allow DWARF expressions to refer to variable values
In Ada, it is possible for a type to refer to the value of local
variables.  In many cases this can be described in the DWARF using
existing LLVM constructs.  However, in some cases, a DWARF expression
that uses multiple variables can be required.

This patch adds a mechanism to allow this.  It adds a new
DIVariableExpression class.  This class holds a DIExpression and a
list of variables.  When DWARF is emitted, each DW_OP_LLVM_arg in the
expression is changed to a DW_OP_GNU_variable_value referencing the
variable's DIE.

DW_OP_GNU_variable_value has been in use in GCC for years.  This has
also been proposed for DWARF 6, though unfortunately it seems to have
stalled:

    http://dwarfstd.org/ShowIssue.php?issue=161109.2

At present this feature is only supported for member offsets and
sizes, and the size of a DICompositeType.  These are just the spots
that I know are needed by gnat-llvm.
2026-02-11 14:24:59 +00:00
..