[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 25 02:50:29 PDT 2025


https://github.com/labath commented:

I'm not sure that what clang is doing is completely compliant. According to the standard, DWARF expression values """can represent a value of any supported base type of the target machine. Instead of a base type, elements can have a generic type, which is an integral type that has the size of an address on the target machine and unspecified signedness""", so using a single value to represent 40 bytes is seems a bit dodgy.  It's kind of obvious what you mean if the value is zero, but it gets a bit fuzzy for other values (where do you place that value, do you sign-extend it, etc.)

Nevertheless, looking at this from the consumer side, I think what you've done is a reasonable interpretation of this, and is better than crashing. I'm just wondering if there isn't a simpler way to express this. See the inline comment about a possible simplification.

https://github.com/llvm/llvm-project/pull/150149


More information about the lldb-commits mailing list