Extend PEI to emit a DWARF expression for StackOffsets that have
a fixed and scalable component. This means the expression that needs
to be added is either:
<base> + offset
or:
<base> + offset + scalable_offset * scalereg
where for SVE, the scale reg is the Vector Granule Dwarf register, which
encodes the number of 64bit 'granules' in an SVE vector and which
the debugger can evaluate at runtime.
I think I would be better to have explicit bool arguments for each of the flags that are contained here. If we keep the mask here, we could later on, when introducing a new flag, end up in situations where the new flag would be ignored by some target implementations, and that could be hard to detect.
Another solution could be to have the deref, stack value and entry value handling in this function, and then have it invoke a getOffsetOpcodes(Offset, Ops) target hook, or something along those lines, that produces the target specific expression for the offset.
At the risk of me overlooking some details for why it would be feasible or practical, I think I would prefer the latter interface.