[Bug 32477] New: Expose ValueObject::Clone at the SB API

Bug ID 32477
Summary Expose ValueObject::Clone at the SB API
Product lldb
Version unspecified
Hardware PC
OS All
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter tberghammer@google.com
CC llvm-bugs@lists.llvm.org

When writing a new synthetic child provider it is often useful to return an
existing ValueObject (SBValue) belonging to some internal data member as a
synthetic child (e.g. the internal pointer inside a unique_ptr).

The current API provides an easy way for doing it (you can access the SBValue
and then return it) but provides no way to change the name of the returned
value object meaning that the returned child will have a strange name (e.g.
_M_ptr). We should have a way to create a synthetic child from an existing
SBValue with a new name.

Note: We should *not* expose ValueObject::SetName as an SB API because that
function should *not* be called from a synthetic child provider as it changes
the name of the underlying non-synthetic child as well.