[Lldb-commits] [lldb] r145437 - in /lldb/trunk: include/lldb/Expression/ClangExpressionDeclMap.h source/Expression/ClangExpressionDeclMap.cpp

Sean Callanan scallanan at apple.com
Tue Nov 29 16:03:22 CST 2011


Author: spyffe
Date: Tue Nov 29 16:03:21 2011
New Revision: 145437

URL: http://llvm.org/viewvc/llvm-project?rev=145437&view=rev
Log:
Modified ClangExpressionDeclMap to use existing
ValueObjects when creating variables referring to
live data rather than constructing
ValueObjectConstResults.

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

Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=145437&r1=145436&r2=145437&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Tue Nov 29 16:03:21 2011
@@ -909,10 +909,14 @@
     ///
     /// @param[in] var
     ///     The LLDB Variable that needs a Decl.
+    ///
+    /// @param[in] valobj
+    ///     The LLDB ValueObject for that variable.
     //------------------------------------------------------------------
     void 
     AddOneVariable (NameSearchContext &context, 
                     lldb::VariableSP var,
+                    lldb::ValueObjectSP valobj,
                     unsigned int current_id);
     
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=145437&r1=145436&r2=145437&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Nov 29 16:03:21 2011
@@ -2507,7 +2507,7 @@
             // If we found a variable in scope, no need to pull up function names
             if (err.Success() && var != NULL)
             {
-                AddOneVariable(context, var, current_id);
+                AddOneVariable(context, var, valobj, current_id);
                 context.m_found.variable = true;
                 return;
             }
@@ -2522,7 +2522,8 @@
             
             if (var)
             {
-                AddOneVariable(context, var, current_id);
+                valobj = frame->TrackGlobalVariable(var, eNoDynamicValues);
+                AddOneVariable(context, var, valobj, current_id);
                 context.m_found.variable = true;
             }
         }
@@ -2728,7 +2729,7 @@
 }
 
 void
-ClangExpressionDeclMap::AddOneVariable (NameSearchContext &context, VariableSP var, unsigned int current_id)
+ClangExpressionDeclMap::AddOneVariable (NameSearchContext &context, VariableSP var, ValueObjectSP valobj, unsigned int current_id)
 {
     assert (m_parser_vars.get());
     
@@ -2757,11 +2758,8 @@
         
     std::string decl_name(context.m_decl_name.getAsString());
     ConstString entity_name(decl_name.c_str());
-    ClangExpressionVariableSP entity(m_found_entities.CreateVariable (m_parser_vars->m_exe_ctx->GetBestExecutionContextScope (),
-                                                                      entity_name, 
-                                                                      ut,
-                                                                      m_parser_vars->m_target_info.byte_order,
-                                                                      m_parser_vars->m_target_info.address_byte_size));
+    ClangExpressionVariableSP entity(m_found_entities.CreateVariable (valobj));
+    
     assert (entity.get());
     entity->EnableParserVars();
     entity->m_parser_vars->m_parser_type = pt;




More information about the lldb-commits mailing list