[Lldb-commits] [lldb] r143663 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Sean Callanan scallanan at apple.com
Thu Nov 3 15:48:37 PDT 2011


Author: spyffe
Date: Thu Nov  3 17:48:37 2011
New Revision: 143663

URL: http://llvm.org/viewvc/llvm-project?rev=143663&view=rev
Log:
Fixed a problem where the "this" pointer didn't
have the correct value in the IRInterpreter.

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143663&r1=143662&r2=143663&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Nov  3 17:48:37 2011
@@ -1038,6 +1038,23 @@
     
     std::auto_ptr<Value> value(GetVariableValue(*m_parser_vars->m_exe_ctx, var, NULL));
     
+    if (value.get() && value->GetValueType() == Value::eValueTypeLoadAddress)
+    {
+        Process *process = m_parser_vars->m_exe_ctx->GetProcessPtr();
+        
+        if (!process)
+            return Value();
+        
+        lldb::addr_t value_addr = value->GetScalar().ULongLong();
+        Error read_error;
+        addr_t ptr_value = process->ReadPointerFromMemory (value_addr, read_error);
+        
+        if (!read_error.Success())
+            return Value();
+        
+        value->GetScalar() = (unsigned long long)ptr_value;
+    }
+    
     if (value.get())
         return *value;
     else





More information about the lldb-commits mailing list