diff options
author | Sean Callanan <scallanan@apple.com> | 2010-07-23 00:16:21 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-07-23 00:16:21 +0000 |
commit | ebf7707e53f443338d7ef99d131d80b193a3991d (patch) | |
tree | 3e384c7291d350ea7a33c3f2650bf26b79ab555f /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | e29e389678e85c759f1e9e59191bdeba200e80d1 (diff) | |
download | bcm5719-llvm-ebf7707e53f443338d7ef99d131d80b193a3991d.tar.gz bcm5719-llvm-ebf7707e53f443338d7ef99d131d80b193a3991d.zip |
Modified TaggedASTType to inherit from ClangASTType
and moved it to its own header file for cleanliness.
Added more logging to ClangFunction so that we can
diagnose crashes in the executing expression.
Added code to extract the result of the expression
from the struct that is passed to the JIT-compiled
code.
llvm-svn: 109199
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 54bfad5772a..1a9e57f0aa7 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -295,8 +295,10 @@ ClangExpressionDeclMap::DoMaterialize (bool dematerialize, iter->m_parser_type.GetOpaqueQualType()), context); - result_value->SetContext(Value::eContextTypeOpaqueClangQualType, - copied_type.GetOpaqueQualType()); + result_value->SetContext(Value::eContextTypeOpaqueClangQualType, copied_type.GetOpaqueQualType()); + + result_value->SetValueType(Value::eValueTypeLoadAddress); + result_value->GetScalar() = (uintptr_t)m_materialized_location + iter->m_offset; } continue; @@ -330,10 +332,8 @@ ClangExpressionDeclMap::DoMaterializeOneVariable(bool dematerialize, return false; } - log->Printf("%s %s with type %p", - (dematerialize ? "Dematerializing" : "Materializing"), - name, - type.GetOpaqueQualType()); + if (log) + log->Printf("%s %s with type %p", (dematerialize ? "Dematerializing" : "Materializing"), name, type.GetOpaqueQualType()); std::auto_ptr<lldb_private::Value> location_value(GetVariableValue(exe_ctx, var, @@ -349,8 +349,7 @@ ClangExpressionDeclMap::DoMaterializeOneVariable(bool dematerialize, { lldb::addr_t value_addr = location_value->GetScalar().ULongLong(); - size_t bit_size = ClangASTContext::GetTypeBitSize (type.GetASTContext(), - type.GetOpaqueQualType()); + size_t bit_size = ClangASTContext::GetTypeBitSize(type.GetASTContext(), type.GetOpaqueQualType()); size_t byte_size = bit_size % 8 ? ((bit_size + 8) / 8) : (bit_size / 8); DataBufferHeap data; @@ -493,9 +492,7 @@ ClangExpressionDeclMap::FindVariableInScope(const SymbolContext &sym_ctx, if (type->GetASTContext() == var->GetType()->GetClangAST()) { - if (!ClangASTContext::AreTypesSame(type->GetASTContext(), - type->GetOpaqueQualType(), - var->GetType()->GetOpaqueClangQualType())) + if (!ClangASTContext::AreTypesSame(type->GetASTContext(), type->GetOpaqueQualType(), var->GetType()->GetOpaqueClangQualType())) return NULL; } else |