================ @@ -618,6 +631,24 @@ class ValueObject { virtual lldb::ValueObjectSP CastPointerType(const char *name, lldb::TypeSP &type_sp); + /// Return the target load address assocaited with this value object. + lldb::addr_t GetLoadAddress(); + + lldb::ValueObjectSP CastDerivedToBaseType(CompilerType type, + const std::vector<uint32_t> &idx); + + lldb::ValueObjectSP CastBaseToDerivedType(CompilerType type, uint64_t offset); + + lldb::ValueObjectSP CastScalarToBasicType(CompilerType type, Status &error); ---------------- clayborg wrote:
Same comment as Jim made below where the returned `lldb::ValueObjectSP` can have its error set correctly. Also, we have a bunch of `CastXXXXToXXXX` calls added below. Do we really need all of these? Can we just have one `lldb::ValueObjectSP Cast(CompilerType type)` function and deduce what should be done internally and fail gracefully? Or if we do need functions specific to `Scalar` and `Enum` we can add just `lldb::ValueObjectSP CastScalar(CompilerType type)` and `lldb::ValueObjectSP CastEnum(CompilerType type)`. It would be great if we just have a single `lldb::ValueObjectSP Cast(CompilerType type)` function that works for everything. We should be able to figure out internally how things are stored (scalar, enum would be deduced from the current `ValueObject`, and figure out what we are casting it to with by looking at `CompilerType` https://github.com/llvm/llvm-project/pull/87197 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits