[llvm-branch-commits] [lldb] r182525 - Reverting these patches. They were causing regressions. :-(

Bill Wendling isanbard at gmail.com
Wed May 22 15:15:26 PDT 2013


Author: void
Date: Wed May 22 17:15:26 2013
New Revision: 182525

URL: http://llvm.org/viewvc/llvm-project?rev=182525&view=rev
Log:
Reverting these patches. They were causing regressions. :-(

--- Reverse-merging r182522 into '.':
U    source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
 U   .
--- Reverse-merging r182521 into '.':
U    source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
 G   .
--- Reverse-merging r182520 into '.':
U    source/Core/ValueObjectVariable.cpp
 G   .
--- Reverse-merging r182519 into '.':
U    source/Symbol/Variable.cpp
 G   .
--- Reverse-merging r182518 into '.':
U    source/Plugins/Process/Linux/ProcessMonitor.cpp
U    source/Plugins/Process/Linux/ProcessLinux.h
 G   .
--- Reverse-merging r182517 into '.':
G    source/Plugins/Process/Linux/ProcessMonitor.cpp
 G   .
--- Reverse-merging r182516 into '.':
U    source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
U    source/Expression/DWARFExpression.cpp
U    source/Expression/Materializer.cpp
U    source/Expression/ClangExpressionDeclMap.cpp
 G   .


Modified:
    lldb/branches/release_33/   (props changed)
    lldb/branches/release_33/source/Core/ValueObjectVariable.cpp
    lldb/branches/release_33/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/release_33/source/Expression/DWARFExpression.cpp
    lldb/branches/release_33/source/Expression/Materializer.cpp
    lldb/branches/release_33/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
    lldb/branches/release_33/source/Plugins/Process/Linux/ProcessLinux.h
    lldb/branches/release_33/source/Plugins/Process/Linux/ProcessMonitor.cpp
    lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/branches/release_33/source/Symbol/Variable.cpp

Propchange: lldb/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 22 17:15:26 2013
@@ -1,2 +1 @@
 /lldb/branches/apple/python-GIL:156467-162159
-/lldb/trunk:182066,182153,182166,182301,182326,182437,182441

Modified: lldb/branches/release_33/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Core/ValueObjectVariable.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/branches/release_33/source/Core/ValueObjectVariable.cpp Wed May 22 17:15:26 2013
@@ -187,7 +187,7 @@ ValueObjectVariable::UpdateValue ()
             switch (value_type)
             {
             default:
-                m_error.SetErrorStringWithFormat("Variable %s has an expression result value %d which is currently unhandled",variable->GetName().GetCString(),value_type);
+                assert(!"Unhandled expression result value kind...");
                 break;
 
             case Value::eValueTypeScalar:

Modified: lldb/branches/release_33/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Expression/ClangExpressionDeclMap.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/release_33/source/Expression/ClangExpressionDeclMap.cpp Wed May 22 17:15:26 2013
@@ -1493,7 +1493,13 @@ ClangExpressionDeclMap::GetVariableValue
             return NULL;
         }
     }
-    
+    else if (!var_location_expr.Evaluate(&m_parser_vars->m_exe_ctx, ast, NULL, NULL, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err))
+    {
+        if (log)
+            log->Printf("Error evaluating location: %s", err.AsCString());
+        return NULL;
+    }
+        
     void *type_to_use = NULL;
     
     if (parser_ast_context)

Modified: lldb/branches/release_33/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Expression/DWARFExpression.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Expression/DWARFExpression.cpp (original)
+++ lldb/branches/release_33/source/Expression/DWARFExpression.cpp Wed May 22 17:15:26 2013
@@ -1303,13 +1303,6 @@ DWARFExpression::Evaluate
     Error *error_ptr
 )
 {
-    
-    if (opcodes_length == 0)
-    {
-        if (error_ptr)
-            error_ptr->SetErrorString ("no location, value may have been optimized out");
-        return false;
-    }
     std::vector<Value> stack;
 
     Process *process = NULL;
@@ -1335,7 +1328,7 @@ DWARFExpression::Evaluate
     if (!opcodes.ValidOffsetForDataOfSize(opcodes_offset, opcodes_length))
     {
         if (error_ptr)
-            error_ptr->SetErrorString ("invalid offset and/or length for opcodes buffer.");
+            error_ptr->SetErrorString ("Invalid offset and/or length for opcodes buffer.");
         return false;
     }
     Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));

Modified: lldb/branches/release_33/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Expression/Materializer.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Expression/Materializer.cpp (original)
+++ lldb/branches/release_33/source/Expression/Materializer.cpp Wed May 22 17:15:26 2013
@@ -89,7 +89,8 @@ public:
         
         if (!allocate_error.Success())
         {
-            err.SetErrorStringWithFormat("couldn't allocate a memory area to store %s: %s", m_persistent_variable_sp->GetName().GetCString(), allocate_error.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't allocate a memory area to store %s: %s", m_persistent_variable_sp->GetName().GetCString(), allocate_error.AsCString());
             return;
         }
         
@@ -122,7 +123,8 @@ public:
         
         if (!write_error.Success())
         {
-            err.SetErrorStringWithFormat ("couldn't write %s to the target: %s", m_persistent_variable_sp->GetName().AsCString(),
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat ("Couldn't write %s to the target: %s", m_persistent_variable_sp->GetName().AsCString(),
                                           write_error.AsCString());
             return;
         }
@@ -138,7 +140,8 @@ public:
             
         if (!deallocate_error.Success())
         {
-            err.SetErrorStringWithFormat ("couldn't deallocate memory for %s: %s", m_persistent_variable_sp->GetName().GetCString(), deallocate_error.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat ("Couldn't deallocate memory for %s: %s", m_persistent_variable_sp->GetName().GetCString(), deallocate_error.AsCString());
         }
     }
     
@@ -175,12 +178,14 @@ public:
             
             if (!write_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't write the location of %s to memory: %s", m_persistent_variable_sp->GetName().AsCString(), write_error.AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't write the location of %s to memory: %s", m_persistent_variable_sp->GetName().AsCString(), write_error.AsCString());
             }
         }
         else
         {
-            err.SetErrorStringWithFormat("no materialization happened for persistent variable %s", m_persistent_variable_sp->GetName().AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("No materialization happened for persistent variable %s", m_persistent_variable_sp->GetName().AsCString());
             return;
         }
     }
@@ -214,7 +219,8 @@ public:
                                 
                 if (!read_error.Success())
                 {
-                    err.SetErrorStringWithFormat("couldn't read the address of program-allocated variable %s: %s", m_persistent_variable_sp->GetName().GetCString(), read_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Couldn't read the address of program-allocated variable %s: %s", m_persistent_variable_sp->GetName().GetCString(), read_error.AsCString());
                     return;
                 }
                                 
@@ -245,13 +251,15 @@ public:
             
             if (!m_persistent_variable_sp->m_live_sp)
             {
-                err.SetErrorStringWithFormat("couldn't find the memory area used to store %s", m_persistent_variable_sp->GetName().GetCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't find the memory area used to store %s", m_persistent_variable_sp->GetName().GetCString());
                 return;
             }
             
             if (m_persistent_variable_sp->m_live_sp->GetValue().GetValueAddressType() != eAddressTypeLoad)
             {
-                err.SetErrorStringWithFormat("the address of the memory area for %s is in an incorrect format", m_persistent_variable_sp->GetName().GetCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("The address of the memory area for %s is in an incorrect format", m_persistent_variable_sp->GetName().GetCString());
                 return;
             }
             
@@ -274,7 +282,8 @@ public:
                 
                 if (!read_error.Success())
                 {
-                    err.SetErrorStringWithFormat ("couldn't read the contents of %s from memory: %s", m_persistent_variable_sp->GetName().GetCString(), read_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat ("Couldn't read the contents of %s from memory: %s", m_persistent_variable_sp->GetName().GetCString(), read_error.AsCString());
                     return;
                 }
                     
@@ -283,7 +292,8 @@ public:
         }
         else
         {
-            err.SetErrorStringWithFormat("no dematerialization happened for persistent variable %s", m_persistent_variable_sp->GetName().AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("No dematerialization happened for persistent variable %s", m_persistent_variable_sp->GetName().AsCString());
             return;
         }
         
@@ -425,7 +435,8 @@ public:
         
         if (!valobj_sp)
         {
-            err.SetErrorStringWithFormat("couldn't get a value object for variable %s", m_variable_sp->GetName().AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't get a value object for variable %s", m_variable_sp->GetName().AsCString());
             return;
         }
         
@@ -441,7 +452,8 @@ public:
             
             if (!write_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't write the contents of reference variable %s to memory: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't write the contents of reference variable %s to memory: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
                 return;
             }
         }
@@ -461,7 +473,8 @@ public:
                 
                 if (!write_error.Success())
                 {
-                    err.SetErrorStringWithFormat("couldn't write the address of variable %s to memory: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Couldn't write the address of variable %s to memory: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
                     return;
                 }
             }
@@ -472,20 +485,15 @@ public:
                 
                 if (m_temporary_allocation != LLDB_INVALID_ADDRESS)
                 {
-                    err.SetErrorStringWithFormat("trying to create a temporary region for %s but one exists", m_variable_sp->GetName().AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Trying to create a temporary region for %s but one exists", m_variable_sp->GetName().AsCString());
                     return;
                 }
                 
                 if (data.GetByteSize() != m_variable_sp->GetType()->GetByteSize())
                 {
-                    if (data.GetByteSize() == 0 && m_variable_sp->LocationExpression().IsValid() == false)
-                    {
-                        err.SetErrorStringWithFormat("the variable '%s' has no location, it may have been optimized out", m_variable_sp->GetName().AsCString());
-                    }
-                    else
-                    {
-                        err.SetErrorStringWithFormat("size of variable %s disagrees with the ValueObject's size", m_variable_sp->GetName().AsCString());
-                    }
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Size of variable %s disagrees with the ValueObject's size", m_variable_sp->GetName().AsCString());
                     return;
                 }
                 
@@ -499,7 +507,8 @@ public:
                 
                 if (!alloc_error.Success())
                 {
-                    err.SetErrorStringWithFormat("couldn't allocate a temporary region for %s: %s", m_variable_sp->GetName().AsCString(), alloc_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Couldn't allocate a temporary region for %s: %s", m_variable_sp->GetName().AsCString(), alloc_error.AsCString());
                     return;
                 }
                 
@@ -509,7 +518,8 @@ public:
                 
                 if (!write_error.Success())
                 {
-                    err.SetErrorStringWithFormat("couldn't write to the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Couldn't write to the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), write_error.AsCString());
                     return;
                 }
                 
@@ -519,7 +529,8 @@ public:
                 
                 if (!pointer_write_error.Success())
                 {
-                    err.SetErrorStringWithFormat("couldn't write the address of the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), pointer_write_error.AsCString());
+                    err.SetErrorToGenericError();
+                    err.SetErrorStringWithFormat("Couldn't write the address of the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), pointer_write_error.AsCString());
                 }
             }
         }
@@ -548,7 +559,8 @@ public:
             
             if (!valobj_sp)
             {
-                err.SetErrorStringWithFormat("couldn't get a value object for variable %s", m_variable_sp->GetName().AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't get a value object for variable %s", m_variable_sp->GetName().AsCString());
                 return;
             }
             
@@ -560,7 +572,8 @@ public:
             
             if (!extract_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't get the data for variable %s", m_variable_sp->GetName().AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't get the data for variable %s", m_variable_sp->GetName().AsCString());
                 return;
             }
             
@@ -570,7 +583,8 @@ public:
             
             if (!set_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't write the new contents of %s back into the variable", m_variable_sp->GetName().AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't write the new contents of %s back into the variable", m_variable_sp->GetName().AsCString());
                 return;
             }
             
@@ -580,7 +594,8 @@ public:
             
             if (!free_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't free the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), free_error.AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't free the temporary region for %s: %s", m_variable_sp->GetName().AsCString(), free_error.AsCString());
                 return;
             }
             
@@ -712,6 +727,7 @@ public:
         {
             if (m_temporary_allocation != LLDB_INVALID_ADDRESS)
             {
+                err.SetErrorToGenericError();
                 err.SetErrorString("Trying to create a temporary region for the result but one exists");
                 return;
             }
@@ -727,7 +743,8 @@ public:
             
             if (!alloc_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't allocate a temporary region for the result: %s", alloc_error.AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't allocate a temporary region for the result: %s", alloc_error.AsCString());
                 return;
             }
                         
@@ -737,7 +754,8 @@ public:
             
             if (!pointer_write_error.Success())
             {
-                err.SetErrorStringWithFormat("couldn't write the address of the temporary region for the result: %s", pointer_write_error.AsCString());
+                err.SetErrorToGenericError();
+                err.SetErrorStringWithFormat("Couldn't write the address of the temporary region for the result: %s", pointer_write_error.AsCString());
             }
         }
     }
@@ -745,6 +763,7 @@ public:
     void Dematerialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb::addr_t process_address,
                         lldb::addr_t frame_top, lldb::addr_t frame_bottom, Error &err)
     {
+        err.SetErrorToGenericError();
         err.SetErrorString("Tried to detmaterialize a result variable with the normal Dematerialize method");
     }
     
@@ -758,6 +777,7 @@ public:
         
         if (!exe_scope)
         {
+            err.SetErrorToGenericError();
             err.SetErrorString("Couldn't dematerialize a result variable: invalid execution context scope");
             return;
         }
@@ -769,6 +789,7 @@ public:
         
         if (!read_error.Success())
         {
+            err.SetErrorToGenericError();
             err.SetErrorString("Couldn't dematerialize a result variable: couldn't read its address");
             return;
         }
@@ -777,6 +798,7 @@ public:
         
         if (!target_sp)
         {
+            err.SetErrorToGenericError();
             err.SetErrorString("Couldn't dematerialize a result variable: no target");
             return;
         }
@@ -793,7 +815,8 @@ public:
         
         if (!ret)
         {
-            err.SetErrorStringWithFormat("couldn't dematerialize a result variable: failed to make persistent variable %s", name.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't dematerialize a result variable: failed to make persistent variable %s", name.AsCString());
             return;
         }
         
@@ -821,6 +844,7 @@ public:
         
         if (!read_error.Success())
         {
+            err.SetErrorToGenericError();
             err.SetErrorString("Couldn't dematerialize a result variable: couldn't read its memory");
             return;
         }
@@ -983,7 +1007,8 @@ public:
         
         if (!target_sp)
         {
-            err.SetErrorStringWithFormat("couldn't resolve symbol %s because there is no target", m_symbol.GetName().AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't resolve symbol %s because there is no target", m_symbol.GetName().AsCString());
             return;
         }
         
@@ -998,7 +1023,8 @@ public:
         
         if (!pointer_write_error.Success())
         {
-            err.SetErrorStringWithFormat("couldn't write the address of symbol %s: %s", m_symbol.GetName().AsCString(), pointer_write_error.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't write the address of symbol %s: %s", m_symbol.GetName().AsCString(), pointer_write_error.AsCString());
             return;
         }
     }
@@ -1094,7 +1120,8 @@ public:
         
         if (!frame_sp.get())
         {
-            err.SetErrorStringWithFormat("couldn't materialize register %s without a stack frame", m_register_info.name);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't materialize register %s without a stack frame", m_register_info.name);
             return;
         }
         
@@ -1102,7 +1129,8 @@ public:
         
         if (!reg_context_sp->ReadRegister(&m_register_info, reg_value))
         {
-            err.SetErrorStringWithFormat("couldn't read the value of register %s", m_register_info.name);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't read the value of register %s", m_register_info.name);
             return;
         }
         
@@ -1110,13 +1138,15 @@ public:
         
         if (!reg_value.GetData(register_data))
         {
-            err.SetErrorStringWithFormat("couldn't get the data for register %s", m_register_info.name);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't get the data for register %s", m_register_info.name);
             return;
         }
         
         if (register_data.GetByteSize() != m_register_info.byte_size)
         {
-            err.SetErrorStringWithFormat("data for register %s had size %llu but we expected %llu", m_register_info.name, (unsigned long long)register_data.GetByteSize(), (unsigned long long)m_register_info.byte_size);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Data for register %s had size %llu but we expected %llu", m_register_info.name, (unsigned long long)register_data.GetByteSize(), (unsigned long long)m_register_info.byte_size);
             return;
         }
         
@@ -1126,7 +1156,8 @@ public:
         
         if (!write_error.Success())
         {
-            err.SetErrorStringWithFormat("couldn't write the contents of register %s: %s", m_register_info.name, write_error.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't write the contents of register %s: %s", m_register_info.name, write_error.AsCString());
             return;
         }
     }
@@ -1149,7 +1180,8 @@ public:
         
         if (!frame_sp.get())
         {
-            err.SetErrorStringWithFormat("couldn't dematerialize register %s without a stack frame", m_register_info.name);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't dematerialize register %s without a stack frame", m_register_info.name);
             return;
         }
         
@@ -1159,7 +1191,8 @@ public:
         
         if (!extract_error.Success())
         {
-            err.SetErrorStringWithFormat("couldn't get the data for register %s: %s", m_register_info.name, extract_error.AsCString());
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't get the data for register %s: %s", m_register_info.name, extract_error.AsCString());
             return;
         }
         
@@ -1167,7 +1200,8 @@ public:
         
         if (!reg_context_sp->WriteRegister(&m_register_info, register_value))
         {
-            err.SetErrorStringWithFormat("couldn't write the value of register %s", m_register_info.name);
+            err.SetErrorToGenericError();
+            err.SetErrorStringWithFormat("Couldn't write the value of register %s", m_register_info.name);
             return;
         }
     }

Modified: lldb/branches/release_33/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp (original)
+++ lldb/branches/release_33/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp Wed May 22 17:15:26 2013
@@ -457,7 +457,7 @@ ObjectContainerBSDArchive::GetObjectFile
                                                        module_sp->GetObjectModificationTime());
             if (object)
             {
-                lldb::offset_t data_offset = object->ar_file_offset;
+                lldb::offset_t data_offset = m_offset + object->ar_file_offset;
                 return ObjectFile::FindPlugin (module_sp,
                                                file, 
                                                m_offset + object->ar_file_offset,

Modified: lldb/branches/release_33/source/Plugins/Process/Linux/ProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Plugins/Process/Linux/ProcessLinux.h?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Plugins/Process/Linux/ProcessLinux.h (original)
+++ lldb/branches/release_33/source/Plugins/Process/Linux/ProcessLinux.h Wed May 22 17:15:26 2013
@@ -75,15 +75,6 @@ public:
     EnablePluginLogging(lldb_private::Stream *strm,
                         lldb_private::Args &command);
 
-    //------------------------------------------------------------------
-    // Plug-in process overrides
-    //------------------------------------------------------------------
-    virtual lldb_private::UnixSignals &
-    GetUnixSignals ()
-    {
-        return m_linux_signals;
-    }
-
 private:
 
     /// Linux-specific signal set.

Modified: lldb/branches/release_33/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/branches/release_33/source/Plugins/Process/Linux/ProcessMonitor.cpp Wed May 22 17:15:26 2013
@@ -1208,13 +1208,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
     ptrace_opts |= PTRACE_O_TRACEEXIT;
 
     // Have the tracer trace threads which spawn in the inferior process.
-    // TODO: if we want to support tracing the inferiors' child, add the
-    // appropriate ptrace flags here (PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
-    ptrace_opts |= PTRACE_O_TRACECLONE;
-
-    // Have the tracer notify us before execve returns
-    // (needed to disable legacy SIGTRAP generation)
-    ptrace_opts |= PTRACE_O_TRACEEXEC;
+    ptrace_opts |= PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACECLONE;
 
     if (PTRACE(PTRACE_SETOPTIONS, pid, NULL, (void*)ptrace_opts, 0) < 0)
     {
@@ -1396,11 +1390,8 @@ ProcessMonitor::MonitorSIGTRAP(ProcessMo
         assert(false && "Unexpected SIGTRAP code!");
         break;
 
-    // TODO: these two cases are required if we want to support tracing
-    // of the inferiors' children
-    // case (SIGTRAP | (PTRACE_EVENT_FORK << 8)):
-    // case (SIGTRAP | (PTRACE_EVENT_VFORK << 8)):
-
+    case (SIGTRAP | (PTRACE_EVENT_FORK << 8)):
+    case (SIGTRAP | (PTRACE_EVENT_VFORK << 8)):
     case (SIGTRAP | (PTRACE_EVENT_CLONE << 8)):
     {
         unsigned long tid = 0;
@@ -1410,11 +1401,6 @@ ProcessMonitor::MonitorSIGTRAP(ProcessMo
         break;
     }
 
-    case (SIGTRAP | (PTRACE_EVENT_EXEC << 8)):
-        // Don't follow the child by default and resume
-        monitor->Resume(pid, SIGCONT);
-        break;
-
     case (SIGTRAP | (PTRACE_EVENT_EXIT << 8)):
     {
         // The inferior process is about to exit.  Maintain the process in a

Modified: lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed May 22 17:15:26 2013
@@ -7175,171 +7175,174 @@ SymbolFileDWARF::ParseVariableDIE
                 }
             }
 
-            ValueType scope = eValueTypeInvalid;
-
-            const DWARFDebugInfoEntry *sc_parent_die = GetParentSymbolContextDIE(die);
-            dw_tag_t parent_tag = sc_parent_die ? sc_parent_die->Tag() : 0;
-            SymbolContextScope * symbol_context_scope = NULL;
-
-            // DWARF doesn't specify if a DW_TAG_variable is a local, global
-            // or static variable, so we have to do a little digging by
-            // looking at the location of a varaible to see if it contains
-            // a DW_OP_addr opcode _somewhere_ in the definition. I say
-            // somewhere because clang likes to combine small global variables
-            // into the same symbol and have locations like:
-            // DW_OP_addr(0x1000), DW_OP_constu(2), DW_OP_plus
-            // So if we don't have a DW_TAG_formal_parameter, we can look at
-            // the location to see if it contains a DW_OP_addr opcode, and
-            // then we can correctly classify  our variables.
-            if (tag == DW_TAG_formal_parameter)
-                scope = eValueTypeVariableArgument;
-            else
+            if (location.IsValid())
             {
-                bool op_error = false;
-                // Check if the location has a DW_OP_addr with any address value...
-                lldb::addr_t location_DW_OP_addr = LLDB_INVALID_ADDRESS;
-                if (!location_is_const_value_data)
+                ValueType scope = eValueTypeInvalid;
+
+                const DWARFDebugInfoEntry *sc_parent_die = GetParentSymbolContextDIE(die);
+                dw_tag_t parent_tag = sc_parent_die ? sc_parent_die->Tag() : 0;
+                SymbolContextScope * symbol_context_scope = NULL;
+
+                // DWARF doesn't specify if a DW_TAG_variable is a local, global
+                // or static variable, so we have to do a little digging by
+                // looking at the location of a varaible to see if it contains
+                // a DW_OP_addr opcode _somewhere_ in the definition. I say
+                // somewhere because clang likes to combine small global variables
+                // into the same symbol and have locations like:
+                // DW_OP_addr(0x1000), DW_OP_constu(2), DW_OP_plus
+                // So if we don't have a DW_TAG_formal_parameter, we can look at
+                // the location to see if it contains a DW_OP_addr opcode, and
+                // then we can correctly classify  our variables.
+                if (tag == DW_TAG_formal_parameter)
+                    scope = eValueTypeVariableArgument;
+                else
                 {
-                    location_DW_OP_addr = location.GetLocation_DW_OP_addr (0, op_error);
-                    if (op_error)
+                    bool op_error = false;
+                    // Check if the location has a DW_OP_addr with any address value...
+                    lldb::addr_t location_DW_OP_addr = LLDB_INVALID_ADDRESS;
+                    if (!location_is_const_value_data)
                     {
-                        StreamString strm;
-                        location.DumpLocationForAddress (&strm, eDescriptionLevelFull, 0, 0, NULL);
-                        GetObjectFile()->GetModule()->ReportError ("0x%8.8x: %s has an invalid location: %s", die->GetOffset(), DW_TAG_value_to_name(die->Tag()), strm.GetString().c_str());
+                        location_DW_OP_addr = location.GetLocation_DW_OP_addr (0, op_error);
+                        if (op_error)
+                        {
+                            StreamString strm;
+                            location.DumpLocationForAddress (&strm, eDescriptionLevelFull, 0, 0, NULL);
+                            GetObjectFile()->GetModule()->ReportError ("0x%8.8x: %s has an invalid location: %s", die->GetOffset(), DW_TAG_value_to_name(die->Tag()), strm.GetString().c_str());
+                        }
                     }
-                }
 
-                if (location_DW_OP_addr != LLDB_INVALID_ADDRESS)
-                {
-                    if (is_external)
-                        scope = eValueTypeVariableGlobal;
-                    else
-                        scope = eValueTypeVariableStatic;
-                    
-                    
-                    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile ();
-                    
-                    if (debug_map_symfile)
+                    if (location_DW_OP_addr != LLDB_INVALID_ADDRESS)
                     {
-                        // When leaving the DWARF in the .o files on darwin,
-                        // when we have a global variable that wasn't initialized,
-                        // the .o file might not have allocated a virtual
-                        // address for the global variable. In this case it will
-                        // have created a symbol for the global variable
-                        // that is undefined/data and external and the value will
-                        // be the byte size of the variable. When we do the
-                        // address map in SymbolFileDWARFDebugMap we rely on
-                        // having an address, we need to do some magic here
-                        // so we can get the correct address for our global
-                        // variable. The address for all of these entries
-                        // will be zero, and there will be an undefined symbol
-                        // in this object file, and the executable will have
-                        // a matching symbol with a good address. So here we
-                        // dig up the correct address and replace it in the
-                        // location for the variable, and set the variable's
-                        // symbol context scope to be that of the main executable
-                        // so the file address will resolve correctly.
-                        bool linked_oso_file_addr = false;
-                        if (is_external && location_DW_OP_addr == 0)
+                        if (is_external)
+                            scope = eValueTypeVariableGlobal;
+                        else
+                            scope = eValueTypeVariableStatic;
+                        
+                        
+                        SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile ();
+                        
+                        if (debug_map_symfile)
                         {
-                            
-                            // we have a possible uninitialized extern global
-                            ConstString const_name(mangled ? mangled : name);
-                            ObjectFile *debug_map_objfile = debug_map_symfile->GetObjectFile();
-                            if (debug_map_objfile)
+                            // When leaving the DWARF in the .o files on darwin,
+                            // when we have a global variable that wasn't initialized,
+                            // the .o file might not have allocated a virtual
+                            // address for the global variable. In this case it will
+                            // have created a symbol for the global variable
+                            // that is undefined/data and external and the value will
+                            // be the byte size of the variable. When we do the
+                            // address map in SymbolFileDWARFDebugMap we rely on
+                            // having an address, we need to do some magic here
+                            // so we can get the correct address for our global
+                            // variable. The address for all of these entries
+                            // will be zero, and there will be an undefined symbol
+                            // in this object file, and the executable will have
+                            // a matching symbol with a good address. So here we
+                            // dig up the correct address and replace it in the
+                            // location for the variable, and set the variable's
+                            // symbol context scope to be that of the main executable
+                            // so the file address will resolve correctly.
+                            bool linked_oso_file_addr = false;
+                            if (is_external && location_DW_OP_addr == 0)
                             {
-                                Symtab *debug_map_symtab = debug_map_objfile->GetSymtab();
-                                if (debug_map_symtab)
+                                
+                                // we have a possible uninitialized extern global
+                                ConstString const_name(mangled ? mangled : name);
+                                ObjectFile *debug_map_objfile = debug_map_symfile->GetObjectFile();
+                                if (debug_map_objfile)
                                 {
-                                    Symbol *exe_symbol = debug_map_symtab->FindFirstSymbolWithNameAndType (const_name,
-                                                                                                           eSymbolTypeData,
-                                                                                                           Symtab::eDebugYes,
-                                                                                                           Symtab::eVisibilityExtern);
-                                    if (exe_symbol)
+                                    Symtab *debug_map_symtab = debug_map_objfile->GetSymtab();
+                                    if (debug_map_symtab)
                                     {
-                                        if (exe_symbol->ValueIsAddress())
+                                        Symbol *exe_symbol = debug_map_symtab->FindFirstSymbolWithNameAndType (const_name,
+                                                                                                               eSymbolTypeData,
+                                                                                                               Symtab::eDebugYes,
+                                                                                                               Symtab::eVisibilityExtern);
+                                        if (exe_symbol)
                                         {
-                                            const addr_t exe_file_addr = exe_symbol->GetAddress().GetFileAddress();
-                                            if (exe_file_addr != LLDB_INVALID_ADDRESS)
+                                            if (exe_symbol->ValueIsAddress())
                                             {
-                                                if (location.Update_DW_OP_addr (exe_file_addr))
+                                                const addr_t exe_file_addr = exe_symbol->GetAddress().GetFileAddress();
+                                                if (exe_file_addr != LLDB_INVALID_ADDRESS)
                                                 {
-                                                    linked_oso_file_addr = true;
-                                                    symbol_context_scope = exe_symbol;
+                                                    if (location.Update_DW_OP_addr (exe_file_addr))
+                                                    {
+                                                        linked_oso_file_addr = true;
+                                                        symbol_context_scope = exe_symbol;
+                                                    }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
-                        }
 
-                        if (!linked_oso_file_addr)
-                        {
-                            // The DW_OP_addr is not zero, but it contains a .o file address which
-                            // needs to be linked up correctly.
-                            const lldb::addr_t exe_file_addr = debug_map_symfile->LinkOSOFileAddress(this, location_DW_OP_addr);
-                            if (exe_file_addr != LLDB_INVALID_ADDRESS)
-                            {
-                                // Update the file address for this variable
-                                location.Update_DW_OP_addr (exe_file_addr);
-                            }
-                            else
+                            if (!linked_oso_file_addr)
                             {
-                                // Variable didn't make it into the final executable
-                                return var_sp;
+                                // The DW_OP_addr is not zero, but it contains a .o file address which
+                                // needs to be linked up correctly.
+                                const lldb::addr_t exe_file_addr = debug_map_symfile->LinkOSOFileAddress(this, location_DW_OP_addr);
+                                if (exe_file_addr != LLDB_INVALID_ADDRESS)
+                                {
+                                    // Update the file address for this variable
+                                    location.Update_DW_OP_addr (exe_file_addr);
+                                }
+                                else
+                                {
+                                    // Variable didn't make it into the final executable
+                                    return var_sp;
+                                }
                             }
                         }
                     }
+                    else
+                    {
+                        scope = eValueTypeVariableLocal;
+                    }
                 }
-                else
-                {
-                    scope = eValueTypeVariableLocal;
-                }
-            }
 
-            if (symbol_context_scope == NULL)
-            {
-                switch (parent_tag)
+                if (symbol_context_scope == NULL)
                 {
-                case DW_TAG_subprogram:
-                case DW_TAG_inlined_subroutine:
-                case DW_TAG_lexical_block:
-                    if (sc.function)
+                    switch (parent_tag)
                     {
-                        symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(MakeUserID(sc_parent_die->GetOffset()));
-                        if (symbol_context_scope == NULL)
-                            symbol_context_scope = sc.function;
+                    case DW_TAG_subprogram:
+                    case DW_TAG_inlined_subroutine:
+                    case DW_TAG_lexical_block:
+                        if (sc.function)
+                        {
+                            symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(MakeUserID(sc_parent_die->GetOffset()));
+                            if (symbol_context_scope == NULL)
+                                symbol_context_scope = sc.function;
+                        }
+                        break;
+                    
+                    default:
+                        symbol_context_scope = sc.comp_unit;
+                        break;
                     }
-                    break;
-                
-                default:
-                    symbol_context_scope = sc.comp_unit;
-                    break;
                 }
-            }
 
-            if (symbol_context_scope)
-            {
-                var_sp.reset (new Variable (MakeUserID(die->GetOffset()), 
-                                            name, 
-                                            mangled,
-                                            SymbolFileTypeSP (new SymbolFileType(*this, type_uid)),
-                                            scope, 
-                                            symbol_context_scope, 
-                                            &decl, 
-                                            location, 
-                                            is_external, 
-                                            is_artificial));
-                
-                var_sp->SetLocationIsConstantValueData (location_is_const_value_data);
-            }
-            else
-            {
-                // Not ready to parse this variable yet. It might be a global
-                // or static variable that is in a function scope and the function
-                // in the symbol context wasn't filled in yet
-                return var_sp;
+                if (symbol_context_scope)
+                {
+                    var_sp.reset (new Variable (MakeUserID(die->GetOffset()), 
+                                                name, 
+                                                mangled,
+                                                SymbolFileTypeSP (new SymbolFileType(*this, type_uid)),
+                                                scope, 
+                                                symbol_context_scope, 
+                                                &decl, 
+                                                location, 
+                                                is_external, 
+                                                is_artificial));
+                    
+                    var_sp->SetLocationIsConstantValueData (location_is_const_value_data);
+                }
+                else
+                {
+                    // Not ready to parse this variable yet. It might be a global
+                    // or static variable that is in a function scope and the function
+                    // in the symbol context wasn't filled in yet
+                    return var_sp;
+                }
             }
         }
         // Cache var_sp even if NULL (the variable was just a specification or

Modified: lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/branches/release_33/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed May 22 17:15:26 2013
@@ -54,8 +54,6 @@ SymbolFileDWARFDebugMap::CompileUnitInfo
         return file_range_map;
     
     ObjectFile *oso_objfile = oso_module->GetObjectFile();
-    if (!oso_objfile)
-        return file_range_map;
     
     Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP));
     if (log)

Modified: lldb/branches/release_33/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Symbol/Variable.cpp?rev=182525&r1=182524&r2=182525&view=diff
==============================================================================
--- lldb/branches/release_33/source/Symbol/Variable.cpp (original)
+++ lldb/branches/release_33/source/Symbol/Variable.cpp Wed May 22 17:15:26 2013
@@ -416,8 +416,8 @@ Variable::GetValuesForVariableExpression
                                     ValueObjectSP variable_valobj_sp(ValueObjectVariable::Create (scope, var_sp));
                                     if (variable_valobj_sp)
                                     {
-                                        const char *variable_sub_expr_path = variable_expr_path + variable_name.size();
-                                        if (*variable_sub_expr_path)
+                                        variable_expr_path += variable_name.size();
+                                        if (*variable_expr_path)
                                         {
                                             const char* first_unparsed = NULL;
                                             ValueObject::ExpressionPathScanEndReason reason_to_stop;
@@ -425,7 +425,7 @@ Variable::GetValuesForVariableExpression
                                             ValueObject::GetValueForExpressionPathOptions options;
                                             ValueObject::ExpressionPathAftermath final_task_on_target;
 
-                                            valobj_sp = variable_valobj_sp->GetValueForExpressionPath (variable_sub_expr_path,
+                                            valobj_sp = variable_valobj_sp->GetValueForExpressionPath (variable_expr_path,
                                                                                                        &first_unparsed,
                                                                                                        &reason_to_stop,
                                                                                                        &final_value_type,
@@ -434,7 +434,7 @@ Variable::GetValuesForVariableExpression
                                             if (!valobj_sp)
                                             {
                                                 error.SetErrorStringWithFormat ("invalid expression path '%s' for variable '%s'",
-                                                                                variable_sub_expr_path,
+                                                                                variable_expr_path,
                                                                                 var_sp->GetName().GetCString());
                                             }
                                         }





More information about the llvm-branch-commits mailing list