[Lldb-commits] [lldb] r161185 - /lldb/trunk/source/Core/ValueObject.cpp
Enrico Granata
egranata at apple.com
Thu Aug 2 10:34:05 PDT 2012
Author: enrico
Date: Thu Aug 2 12:34:05 2012
New Revision: 161185
URL: http://llvm.org/viewvc/llvm-project?rev=161185&view=rev
Log:
<rdar://problem/11846023> Fixing a bug where malformed DWARF could lead to an endless recursion with synthetic children
Modified:
lldb/trunk/source/Core/ValueObject.cpp
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=161185&r1=161184&r2=161185&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Aug 2 12:34:05 2012
@@ -2020,7 +2020,9 @@
{
// We haven't made a synthetic array member for expression yet, so
// lets make one and cache it for any future reference.
- synthetic_child_sp = GetValueForExpressionPath(expression);
+ synthetic_child_sp = GetValueForExpressionPath(expression,
+ NULL, NULL, NULL,
+ GetValueForExpressionPathOptions().DontAllowSyntheticChildren());
// Cache the value if we got one back...
if (synthetic_child_sp.get())
@@ -2486,10 +2488,14 @@
else if (options.m_no_synthetic_children == false) // let's try with synthetic children
{
if (root->IsSynthetic())
- child_valobj_sp = root;
- else
- child_valobj_sp = root->GetSyntheticValue();
-
+ {
+ *first_unparsed = expression_cstr;
+ *reason_to_stop = ValueObject::eExpressionPathScanEndReasonNoSuchChild;
+ *final_result = ValueObject::eExpressionPathEndResultTypeInvalid;
+ return ValueObjectSP();
+ }
+
+ child_valobj_sp = root->GetSyntheticValue();
if (child_valobj_sp.get())
child_valobj_sp = child_valobj_sp->GetChildMemberWithName(child_name, true);
}
@@ -2524,6 +2530,14 @@
}
else if (options.m_no_synthetic_children == false) // let's try with synthetic children
{
+ if (root->IsSynthetic())
+ {
+ *first_unparsed = expression_cstr;
+ *reason_to_stop = ValueObject::eExpressionPathScanEndReasonNoSuchChild;
+ *final_result = ValueObject::eExpressionPathEndResultTypeInvalid;
+ return ValueObjectSP();
+ }
+
child_valobj_sp = root->GetSyntheticValue(true);
if (child_valobj_sp)
child_valobj_sp = child_valobj_sp->GetChildMemberWithName(child_name, true);
More information about the lldb-commits
mailing list