diff options
author | Jim Ingham <jingham@apple.com> | 2014-05-05 02:26:40 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-05-05 02:26:40 +0000 |
commit | 1624a2d3c8a9558840b5e17623d232c0aa3c01cd (patch) | |
tree | d11f0105a8cca2f3a4c887fbe278b570281ab367 /lldb/source/Core/Error.cpp | |
parent | e8a7afef86220229a872b78b5e3dd212574d741a (diff) | |
download | bcm5719-llvm-1624a2d3c8a9558840b5e17623d232c0aa3c01cd.tar.gz bcm5719-llvm-1624a2d3c8a9558840b5e17623d232c0aa3c01cd.zip |
Make the Expression Execution result enum available to the SB API layer.
Add a callback that will allow an expression to be cancelled between the
expression evaluation stages (for the ClangUserExpressions.)
<rdar://problem/16790467>, <rdar://problem/16573440>
llvm-svn: 207944
Diffstat (limited to 'lldb/source/Core/Error.cpp')
-rw-r--r-- | lldb/source/Core/Error.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp index bbcf39d7438..8929568aa68 100644 --- a/lldb/source/Core/Error.cpp +++ b/lldb/source/Core/Error.cpp @@ -264,6 +264,35 @@ Error::SetMachError (uint32_t err) m_string.clear(); } +void +Error::SetExpressionError (lldb::ExpressionResults result, const char *mssg) +{ + m_code = result; + m_type = eErrorTypeExpression; + m_string = mssg; +} + +int +Error::SetExpressionErrorWithFormat (lldb::ExpressionResults result, const char *format, ...) +{ + int length = 0; + + if (format && format[0]) + { + va_list args; + va_start (args, format); + length = SetErrorStringWithVarArg (format, args); + va_end (args); + } + else + { + m_string.clear(); + } + m_code = result; + m_type = eErrorTypeExpression; + return length; +} + //---------------------------------------------------------------------- // Set accesssor for the error value and type. //---------------------------------------------------------------------- |