Fixing a bug where child names in filters were not matched properly

llvm-svn: 153101
This commit is contained in:
Enrico Granata 2012-03-20 18:02:56 +00:00
parent 816ca27ef6
commit c2c4e34a46
2 changed files with 12 additions and 1 deletions

View File

@ -573,7 +573,14 @@ public:
for (int i = 0; i < filter->GetCount(); i++) for (int i = 0; i < filter->GetCount(); i++)
{ {
const char* expr_cstr = filter->GetExpressionPathAtIndex(i); const char* expr_cstr = filter->GetExpressionPathAtIndex(i);
if (::strcmp(name_cstr, expr_cstr)) if (expr_cstr)
{
if (*expr_cstr == '.')
expr_cstr++;
else if (*expr_cstr == '-' && *(expr_cstr+1) == '>')
expr_cstr += 2;
}
if (!::strcmp(name_cstr, expr_cstr))
return i; return i;
} }
return UINT32_MAX; return UINT32_MAX;

View File

@ -118,6 +118,8 @@ ValueObjectSynthetic::GetChildAtIndex (uint32_t idx, bool can_create)
if (can_create && m_synth_filter_ap.get() != NULL) if (can_create && m_synth_filter_ap.get() != NULL)
{ {
lldb::ValueObjectSP synth_guy = m_synth_filter_ap->GetChildAtIndex (idx, can_create); lldb::ValueObjectSP synth_guy = m_synth_filter_ap->GetChildAtIndex (idx, can_create);
if (!synth_guy)
return synth_guy;
m_children_byindex[idx]= synth_guy.get(); m_children_byindex[idx]= synth_guy.get();
return synth_guy; return synth_guy;
} }
@ -151,6 +153,8 @@ ValueObjectSynthetic::GetIndexOfChildWithName (const ConstString &name)
if (iter == m_name_toindex.end() && m_synth_filter_ap.get() != NULL) if (iter == m_name_toindex.end() && m_synth_filter_ap.get() != NULL)
{ {
uint32_t index = m_synth_filter_ap->GetIndexOfChildWithName (name); uint32_t index = m_synth_filter_ap->GetIndexOfChildWithName (name);
if (index == UINT32_MAX)
return index;
m_name_toindex[name.GetCString()] = index; m_name_toindex[name.GetCString()] = index;
return index; return index;
} }