diff options
author | Jim Ingham <jingham@apple.com> | 2015-11-03 02:11:24 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2015-11-03 02:11:24 +0000 |
commit | 19a63fc6faa85b094e23fe15d432c7c66a5df2c6 (patch) | |
tree | 98acc906bae6e36df75e07d46f9fe73d117ba987 /lldb/source | |
parent | 95c453a221d5e757830145c2d5198c3a9da3f4b2 (diff) | |
download | bcm5719-llvm-19a63fc6faa85b094e23fe15d432c7c66a5df2c6.tar.gz bcm5719-llvm-19a63fc6faa85b094e23fe15d432c7c66a5df2c6.zip |
Add the ability to pass an EvaluateExpressionOptions when you make a UserExpression. This
isn't used in this commit but will be in a future commit.
llvm-svn: 251887
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocation.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Breakpoint/Watchpoint.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Expression/LLVMUserExpression.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Expression/UserExpression.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h | 2 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Symbol/GoASTContext.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 3 |
11 files changed, 40 insertions, 20 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index f64577b3743..5ff91102aad 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -293,6 +293,7 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error) nullptr, language, Expression::eResultTypeAny, + EvaluateExpressionOptions(), error)); if (error.Fail()) { diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp index afc217f2a73..363fa9a8fa7 100644 --- a/lldb/source/Breakpoint/Watchpoint.cpp +++ b/lldb/source/Breakpoint/Watchpoint.cpp @@ -387,6 +387,7 @@ Watchpoint::SetCondition (const char *condition) nullptr, lldb::eLanguageTypeUnknown, UserExpression::eResultTypeAny, + EvaluateExpressionOptions(), error)); if (error.Fail()) { diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp index cd28834a962..8c1c7bf3040 100644 --- a/lldb/source/Expression/LLVMUserExpression.cpp +++ b/lldb/source/Expression/LLVMUserExpression.cpp @@ -40,9 +40,13 @@ using namespace lldb_private; -LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, - lldb::LanguageType language, ResultType desired_type) - : UserExpression(exe_scope, expr, expr_prefix, language, desired_type), +LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope, + const char *expr, + const char *expr_prefix, + lldb::LanguageType language, + ResultType desired_type, + const EvaluateExpressionOptions &options) + : UserExpression(exe_scope, expr, expr_prefix, language, desired_type, options), m_stack_frame_bottom(LLDB_INVALID_ADDRESS), m_stack_frame_top(LLDB_INVALID_ADDRESS), m_transformed_text(), diff --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp index 23e93d34438..70f004ba25c 100644 --- a/lldb/source/Expression/UserExpression.cpp +++ b/lldb/source/Expression/UserExpression.cpp @@ -45,13 +45,18 @@ using namespace lldb_private; -UserExpression::UserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, - lldb::LanguageType language, ResultType desired_type) - : Expression(exe_scope), +UserExpression::UserExpression (ExecutionContextScope &exe_scope, + const char *expr, + const char *expr_prefix, + lldb::LanguageType language, + ResultType desired_type, + const EvaluateExpressionOptions &options) : + Expression(exe_scope), m_expr_text(expr), m_expr_prefix(expr_prefix ? expr_prefix : ""), m_language(language), - m_desired_type(desired_type) + m_desired_type(desired_type), + m_options (options) { } @@ -219,6 +224,7 @@ UserExpression::Evaluate (ExecutionContext &exe_ctx, full_prefix, language, desired_type, + options, error)); if (error.Fail()) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp index 0a53f119130..b78d5a2e45d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -55,10 +55,14 @@ using namespace lldb_private; -ClangUserExpression::ClangUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, - lldb::LanguageType language, ResultType desired_type) - : LLVMUserExpression(exe_scope, expr, expr_prefix, language, desired_type), - m_type_system_helper(*m_target_wp.lock().get()) +ClangUserExpression::ClangUserExpression (ExecutionContextScope &exe_scope, + const char *expr, + const char *expr_prefix, + lldb::LanguageType language, + ResultType desired_type, + const EvaluateExpressionOptions &options) : + LLVMUserExpression (exe_scope, expr, expr_prefix, language, desired_type, options), + m_type_system_helper(*m_target_wp.lock().get()) { switch (m_language) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h index 31416b84f17..042a070ff20 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h @@ -118,7 +118,8 @@ public: const char *expr, const char *expr_prefix, lldb::LanguageType language, - ResultType desired_type); + ResultType desired_type, + const EvaluateExpressionOptions &options); ~ClangUserExpression() override; diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp index 117a480928c..7cc294eeb2f 100644 --- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp @@ -218,8 +218,9 @@ LookupType(TargetSP target, ConstString name) return CompilerType(); } GoUserExpression::GoUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, - lldb::LanguageType language, ResultType desired_type) - : UserExpression(exe_scope, expr, expr_prefix, language, desired_type) + lldb::LanguageType language, ResultType desired_type, + const EvaluateExpressionOptions &options) + : UserExpression(exe_scope, expr, expr_prefix, language, desired_type, options) { } diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h index 92a26458b70..5cee22deb80 100644 --- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h @@ -66,7 +66,7 @@ class GoUserExpression : public UserExpression { public: GoUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, - lldb::LanguageType language, ResultType desired_type); + lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options); virtual bool Parse(Stream &error_stream, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) override; diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 383758876c5..0e251157a92 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -9227,13 +9227,14 @@ UserExpression * ClangASTContextForExpressions::GetUserExpression (const char *expr, const char *expr_prefix, lldb::LanguageType language, - Expression::ResultType desired_type) + Expression::ResultType desired_type, + const EvaluateExpressionOptions &options) { TargetSP target_sp = m_target_wp.lock(); if (!target_sp) return nullptr; - return new ClangUserExpression(*target_sp.get(), expr, expr_prefix, language, desired_type); + return new ClangUserExpression(*target_sp.get(), expr, expr_prefix, language, desired_type, options); } FunctionCaller * diff --git a/lldb/source/Symbol/GoASTContext.cpp b/lldb/source/Symbol/GoASTContext.cpp index e025f21a649..46bb7d3c0fc 100644 --- a/lldb/source/Symbol/GoASTContext.cpp +++ b/lldb/source/Symbol/GoASTContext.cpp @@ -1509,10 +1509,10 @@ GoASTContext::GetDWARFParser() UserExpression * GoASTContextForExpr::GetUserExpression(const char *expr, const char *expr_prefix, lldb::LanguageType language, - Expression::ResultType desired_type) + Expression::ResultType desired_type, const EvaluateExpressionOptions &options) { TargetSP target = m_target_wp.lock(); if (target) - return new GoUserExpression(*target, expr, expr_prefix, language, desired_type); + return new GoUserExpression(*target, expr, expr_prefix, language, desired_type, options); return nullptr; } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index d3377bef871..1f6bacca2b4 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1993,6 +1993,7 @@ Target::GetUserExpressionForLanguage(const char *expr, const char *expr_prefix, lldb::LanguageType language, Expression::ResultType desired_type, + const EvaluateExpressionOptions &options, Error &error) { Error type_system_error; @@ -2006,7 +2007,7 @@ Target::GetUserExpressionForLanguage(const char *expr, return nullptr; } - user_expr = type_system->GetUserExpression(expr, expr_prefix, language, desired_type); + user_expr = type_system->GetUserExpression(expr, expr_prefix, language, desired_type, options); if (!user_expr) error.SetErrorStringWithFormat("Could not create an expression for language %s", Language::GetNameForLanguageType(language)); |