kuilpd wrote:
I'm trying here an alternative way of creating a const `ValueObject`. The way it's currently done with `CreateValueObjectFromAPInt` is getting its data bytes and sending them to `ValueObject::CreateValueObjectFromData`, which creates a `ValueObjectConstResult` with `ValueType::HostAddress`, which means that when converting that `ValueObject` back to an `APInt` it needs to go through a whole process of resolving the address and re-creating a Scalar from data (please correct me if I misunderstood this process). Btw, that last when is the part where Scalar [defaults to 32 bit width](https://github.com/llvm/llvm-project/blob/56944e606a1ba24e71fc89fad1eabb97e8240d65/lldb/source/Symbol/CompilerType.cpp#L1141), but for the host width of `int`, not the target. Instead, I'm creating a `ValueObjectConstResult` straight from a `Scalar` with `ValueType::Scalar`, which is stored in a `Value` field and gets immediately returned when resolving the `ValueObject` back to a `Scalar`. As far as I understand, this is all we need from for constant values, and it makes the process of wrapping/unwrapping scalars from values object faster. I had to fix `Scalar::GetData` though, to be able to return its data bytes with a larger size then its own byte size, as otherwise it crashed other parts of LLDB when it tried to get bytes from a `Value` with a larger compiler type size. https://github.com/llvm/llvm-project/pull/151350 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits