Commit ce59b557 authored by Bill Wendling's avatar Bill Wendling
Browse files

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   .

llvm-svn: 182525
parent 04df32da
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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:
+7 −1
Original line number Diff line number Diff line
@@ -1493,6 +1493,12 @@ 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;
    
+1 −8
Original line number Diff line number Diff line
@@ -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));
+76 −42
Original line number Diff line number Diff line
@@ -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;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ ObjectContainerBSDArchive::GetObjectFile (const FileSpec *file)
                                                       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,
Loading