summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBValue.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-12-08 23:13:56 +0000
committerEnrico Granata <egranata@apple.com>2014-12-08 23:13:56 +0000
commit0c10a85000074f1e8ac0fa88c853ede7b45818d4 (patch)
treedde9dd18ac5ece1dcde76e8e67638baa44d270ed /lldb/source/API/SBValue.cpp
parentf5b4d655d2de3fcc7b89eb33aef5a95e01aefdb9 (diff)
downloadbcm5719-llvm-0c10a85000074f1e8ac0fa88c853ede7b45818d4.tar.gz
bcm5719-llvm-0c10a85000074f1e8ac0fa88c853ede7b45818d4.zip
Add the ability for an SBValue to create a persisted version of itself.
Such a persisted version is equivalent to evaluating the value via the expression evaluator, and holding on to the $n result of the expression, except this API can be used on SBValues that do not obviously come from an expression (e.g. are the result of a memory lookup) Expose this via SBValue::Persist() in our public API layer, and ValueObject::Persist() in the lldb_private layer Includes testcase Fixes rdar://19136664 llvm-svn: 223711
Diffstat (limited to 'lldb/source/API/SBValue.cpp')
-rw-r--r--lldb/source/API/SBValue.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index f56013a03e0..f8c75eb351c 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -1892,3 +1892,16 @@ SBValue::WatchPointee (bool resolve_location, bool read, bool write, SBError &er
sb_watchpoint = Dereference().Watch (resolve_location, read, write, error);
return sb_watchpoint;
}
+
+lldb::SBValue
+SBValue::Persist ()
+{
+ ValueLocker locker;
+ lldb::ValueObjectSP value_sp(GetSP(locker));
+ SBValue persisted_sb;
+ if (value_sp)
+ {
+ persisted_sb.SetSP(value_sp->Persist());
+ }
+ return persisted_sb;
+}
OpenPOWER on IntegriCloud