summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Debugger.cpp6
-rw-r--r--lldb/source/Core/ValueObject.cpp48
2 files changed, 45 insertions, 9 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 8d13293640e..08cbb1c4755 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -795,7 +795,7 @@ ScanBracketedRange(const char* var_name_begin,
*index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
*index_higher = *index_lower;
if (log)
- log->Printf("[%d] detected, high index is same",index_lower);
+ log->Printf("[%d] detected, high index is same", *index_lower);
}
else if (*close_bracket_position && *close_bracket_position < var_name_end)
{
@@ -803,7 +803,7 @@ ScanBracketedRange(const char* var_name_begin,
*index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
*index_higher = ::strtoul (*separator_position+1, &end, 0);
if (log)
- log->Printf("[%d-%d] detected",index_lower,index_higher);
+ log->Printf("[%d-%d] detected", *index_lower, *index_higher);
}
else
{
@@ -1044,7 +1044,7 @@ Debugger::FormatPrompt
ValueObject::ExpressionPathAftermath what_next = (do_deref_pointer ?
ValueObject::eDereference : ValueObject::eNothing);
ValueObject::GetValueForExpressionPathOptions options;
- options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar();
+ options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().DoAllowSyntheticChildren();
ValueObject::ValueObjectRepresentationStyle val_obj_display = ValueObject::eDisplaySummary;
ValueObject* target = NULL;
lldb::Format custom_format = eFormatInvalid;
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 80c8d5acd0f..fe27d712842 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -2032,13 +2032,28 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr,
if (!next_separator) // if no other separator just expand this last layer
{
child_name.SetCString (expression_cstr);
- root = root->GetChildMemberWithName(child_name, true);
- if (root.get()) // we know we are done, so just return
+ ValueObjectSP child_valobj_sp = root->GetChildMemberWithName(child_name, true);
+
+ if (child_valobj_sp.get()) // we know we are done, so just return
{
*first_unparsed = '\0';
*reason_to_stop = ValueObject::eEndOfString;
*final_result = ValueObject::ePlain;
- return root;
+ return child_valobj_sp;
+ }
+ else if (options.m_no_synthetic_children == false) // let's try with synthetic children
+ {
+ child_valobj_sp = root->GetSyntheticValue(lldb::eUseSyntheticFilter)->GetChildMemberWithName(child_name, true);
+ }
+
+ // if we are here and options.m_no_synthetic_children is true, child_valobj_sp is going to be a NULL SP,
+ // so we hit the "else" branch, and return an error
+ if(child_valobj_sp.get()) // if it worked, just return
+ {
+ *first_unparsed = '\0';
+ *reason_to_stop = ValueObject::eEndOfString;
+ *final_result = ValueObject::ePlain;
+ return child_valobj_sp;
}
else
{
@@ -2051,9 +2066,24 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr,
else // other layers do expand
{
child_name.SetCStringWithLength(expression_cstr, next_separator - expression_cstr);
- root = root->GetChildMemberWithName(child_name, true);
- if (root.get()) // store the new root and move on
+ ValueObjectSP child_valobj_sp = root->GetChildMemberWithName(child_name, true);
+ if (child_valobj_sp.get()) // store the new root and move on
+ {
+ root = child_valobj_sp;
+ *first_unparsed = next_separator;
+ *final_result = ValueObject::ePlain;
+ continue;
+ }
+ else if (options.m_no_synthetic_children == false) // let's try with synthetic children
+ {
+ child_valobj_sp = root->GetSyntheticValue(lldb::eUseSyntheticFilter)->GetChildMemberWithName(child_name, true);
+ }
+
+ // if we are here and options.m_no_synthetic_children is true, child_valobj_sp is going to be a NULL SP,
+ // so we hit the "else" branch, and return an error
+ if(child_valobj_sp.get()) // if it worked, move on
{
+ root = child_valobj_sp;
*first_unparsed = next_separator;
*final_result = ValueObject::ePlain;
continue;
@@ -2236,7 +2266,7 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr,
return root;
}
}
- else if (root->HasSyntheticValue() && options.m_no_synthetic_children)
+ else if (root->HasSyntheticValue() && options.m_no_synthetic_children == false)
{
root = root->GetSyntheticValue(lldb::eUseSyntheticFilter)->GetChildAtIndex(index, true);
if (!root.get())
@@ -2246,6 +2276,12 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr,
*final_result = ValueObject::eInvalid;
return ValueObjectSP();
}
+ else
+ {
+ *first_unparsed = end+1; // skip ]
+ *final_result = ValueObject::ePlain;
+ continue;
+ }
}
else
{
OpenPOWER on IntegriCloud