Exemple #1
0
SymSet SubtypeUnqualifier::bindings() const {
  SymSet r;
  for (SubtypeEliminators::const_iterator e = this->eliminators.begin(); e != this->eliminators.end(); ++e) {
    SymSet x = (*e)->bindings();
    r.insert(x.begin(), x.end());
  }
  return r;
}
Exemple #2
0
SymSet UnqualifierSet::bindings() const {
  SymSet r;
  for (Unqualifiers::const_iterator uq = this->uqs.begin(); uq != this->uqs.end(); ++uq) {
    SymSet qr = uq->second->bindings();
    r.insert(qr.begin(), qr.end());
  }
  return r;
}
Exemple #3
0
RefPtr<DebugSymbol>
lookup_child(DebugSymbol& obj, const char* name, SymSet& symset)
{
    if (!symset.insert(make_pair(obj.name(), obj.addr())).second)
    {
        return NULL;
    }
    InfiniteRecursivityGuard guard(symset, &obj);

    if (!obj.value())
    {
        obj.read(NULL);
    }

    DebugSymbolList objects;
    ClassType* klass = interface_cast<ClassType*>(obj.type());

    const size_t count = obj.enum_children(NULL);

    for (size_t n = 0; n != count; ++n)
    {
        RefPtr<DebugSymbol> child = obj.nth_child(n);

        if (!child->name())
        {
            continue;
        }
        if (child->name()->is_equal(name))
        {
            return child;
        }

        // build a list of anonymous members and base classes
        // to recurse into
        if (klass)
        {
            if (child->name()->is_equal2(unnamed_type()))
            {
                assert (interface_cast<ClassType*>(child->type()));
                objects.push_back(child);
            }
            else if (child->type()
                  && klass->lookup_base(child->type()->name(), NULL, true))
            {
                objects.push_back(child);
            }
        }
        else if (interface_cast<ClassType*>(child->type()))
        {
            objects.push_back(child);
        }
    }
    // now dive into base classes
    for (DebugSymbolList::const_iterator i = objects.begin();
         i != objects.end();
         ++i)
    {
        if (RefPtr<DebugSymbol> child = lookup_child(**i, name, symset))
        {
            return child;
        }
    }
    return NULL;
}