[Lldb-commits] [lldb] [lldb] Add `ValueObject::CreateValueObjectFromScalar` and fix `Scalar::GetData` (PR #151350)

Ilia Kuklin via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 30 11:53:39 PDT 2025


kuilpd wrote:

> One big behavioral difference between your `CreateValueObjectFromValue` VO's and the `CreateValueObjectFromAPInt` ones is that you set the child address type to invalid, but the APInt one sets it to "load". That's fine so long as the Value only holds ints and not pointer values. Dereference on the Value ones will be an error - since we don't know where the children are...
> 
> There aren't any examples of how you intend to use this yet, so I can't tell whether that is a concern. But given it is a significant difference between the two API's it should be called out somehow.

By default its just const values, but if we aim to create a pointer type, we can just change do `ValueObject::SetAddressTypeOfChildren` after creating it. Or can just make it the default, it doesn't matter until there actually are some children, right? I'll check later if I can create pointer normally with this approach.

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


More information about the lldb-commits mailing list