diff options
author | Jim Ingham <jingham@apple.com> | 2015-10-31 00:02:18 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2015-10-31 00:02:18 +0000 |
commit | 98e6daf1fb3fa2099a84a39d97f7e6958626dc71 (patch) | |
tree | 3b3d3e7c16acabb375980011ee8f4639d53c4b3f /lldb/source/Core/ValueObject.cpp | |
parent | 21e153748a68d13d0d4735b3204346d14ed489c2 (diff) | |
download | bcm5719-llvm-98e6daf1fb3fa2099a84a39d97f7e6958626dc71.tar.gz bcm5719-llvm-98e6daf1fb3fa2099a84a39d97f7e6958626dc71.zip |
Abstract the notion of the truth value of an expression result, for use
in breakpoint conditions.
llvm-svn: 251727
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index ecafd202e4c..11ccd1bcfb6 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -513,6 +513,26 @@ ValueObject::ResolveValue (Scalar &scalar) } bool +ValueObject::IsLogicalTrue (Error& error) +{ + Scalar scalar_value; + + if (!ResolveValue (scalar_value)) + { + error.SetErrorString("failed to get a scalar result"); + return false; + } + + bool ret; + if (scalar_value.ULongLong(1) == 0) + ret = false; + else + ret = true; + error.Clear(); + return ret; +} + +bool ValueObject::GetValueIsValid () const { return m_value_is_valid; |