diff options
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 7cff6fd2974..f82f5ae2e7e 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -61,6 +61,11 @@ ClangExpressionDeclMap::ClangExpressionDeclMap (bool keep_result_in_memory) : ClangExpressionDeclMap::~ClangExpressionDeclMap() { + // Note: The model is now that the parser's AST context and all associated + // data does not vanish until the expression has been executed. This means + // that valuable lookup data (like namespaces) doesn't vanish, but + + DidParse(); DidDematerialize(); DisableStructVars(); } @@ -933,6 +938,9 @@ ClangExpressionDeclMap::LookupDecl (clang::NamedDecl *decl) if (expr_var_sp) { + if (!expr_var_sp->m_parser_vars.get()) + return Value(); + const ConstString &name(expr_var_sp->GetName()); TypeFromUser type(expr_var_sp->GetTypeFromUser()); @@ -1621,7 +1629,7 @@ ClangExpressionDeclMap::DoMaterializeOneVariable Process *process = exe_ctx.GetProcessPtr(); StackFrame *frame = exe_ctx.GetFramePtr(); - if (!frame || !process || !target) + if (!frame || !process || !target || !m_parser_vars.get() || !expr_var->m_parser_vars.get()) return false; // Vital information about the value diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 9ded61adfc7..b5bad503155 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -276,9 +276,7 @@ ClangUserExpression::Parse (Stream &error_stream, log->Printf("Data buffer contents:\n%s", dump_string.GetString().c_str()); } - - m_expr_decl_map->DidParse(); - + if (jit_error.Success()) { if (process && m_jit_alloc != LLDB_INVALID_ADDRESS) @@ -449,6 +447,7 @@ ClangUserExpression::FinalizeJITExecution (Stream &error_stream, error_stream.Printf ("Couldn't dematerialize struct : %s\n", expr_error.AsCString("unknown error")); return false; } + return true; } |