Author: gclayton
Date: Thu Jan 23 16:55:05 2014
New Revision: 199953
URL: http://llvm.org/viewvc/llvm-project?rev=199953&view=rev
Log:
Don't copy entire value into m_data unless we need to. If we did this and the
entire variable failed to be read, we wouldn't be able to display any actual
values that were in good memory. This will also make things more efficient by
not have every struct/union/class/array copy its entire value into a
ValueObject.m_data even though no one was using it.
Modified:
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Core/ValueObjectChild.cpp
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=199953&r1=199952&r2=199953&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Jan 23 16:55:05 2014
@@ -978,14 +978,14 @@ ValueObject::GetPointeeData (DataExtract
ValueObjectSP pointee_sp = Dereference(error);
if (error.Fail() || pointee_sp.get() == NULL)
return 0;
- return pointee_sp->GetDataExtractor().Copy(data);
+ return pointee_sp->GetData(data);
}
else
{
ValueObjectSP child_sp = GetChildAtIndex(0, true);
if (child_sp.get() == NULL)
return 0;
- return child_sp->GetDataExtractor().Copy(data);
+ return child_sp->GetData(data);
}
return true;
}
Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=199953&r1=199952&r2=199953&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Thu Jan 23 16:55:05 2014
@@ -207,7 +207,10 @@ ValueObjectChild::UpdateValue ()
if (m_error.Success())
{
ExecutionContext exe_ctx (GetExecutionContextRef().Lock());
- m_error = m_value.GetValueAsData (&exe_ctx, m_data, 0,
GetModule().get());
+ if (GetClangType().GetTypeInfo() & ClangASTType::eTypeHasValue)
+ m_error = m_value.GetValueAsData (&exe_ctx, m_data, 0,
GetModule().get());
+ else
+ m_error.Clear(); // No value so nothing to read...
}
}
else
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits