From f65dcba83ce5035ab88a85fe17628b447eb56e1b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 2 Dec 2021 22:02:54 +0100 Subject: Vendor import of llvm-project main llvmorg-14-init-11187-g222442ec2d71. --- lldb/source/API/SBValue.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lldb/source/API/SBValue.cpp') diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 9faee102c5e3..e3325b8d36fa 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -1431,6 +1431,18 @@ bool SBValue::SetData(lldb::SBData &data, SBError &error) { return ret; } +lldb::SBValue SBValue::Clone(const char *new_name) { + LLDB_RECORD_METHOD(lldb::SBValue, SBValue, Clone, (const char *), new_name); + + ValueLocker locker; + lldb::ValueObjectSP value_sp(GetSP(locker)); + + if (value_sp) + return lldb::SBValue(value_sp->Clone(ConstString(new_name))); + else + return lldb::SBValue(); +} + lldb::SBDeclaration SBValue::GetDeclaration() { LLDB_RECORD_METHOD_NO_ARGS(lldb::SBDeclaration, SBValue, GetDeclaration); @@ -1656,6 +1668,7 @@ void RegisterMethods(Registry &R) { LLDB_REGISTER_METHOD(lldb::SBData, SBValue, GetData, ()); LLDB_REGISTER_METHOD(bool, SBValue, SetData, (lldb::SBData &, lldb::SBError &)); + LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, Clone, (const char *)); LLDB_REGISTER_METHOD(lldb::SBDeclaration, SBValue, GetDeclaration, ()); LLDB_REGISTER_METHOD(lldb::SBWatchpoint, SBValue, Watch, (bool, bool, bool, lldb::SBError &)); -- cgit v1.3