src/developer/debug/zxdb/expr/resolve_collection.cc
ErrOr<FoundMember> FindMemberWithErr(const Collection* base, const ParsedIdentifier& identifier) {
  if (!base) {
    return Err("Can't resolve '%s' on non-struct/class/union value.",
               identifier.GetFullName().c_str());
  }

  FindNameOptions options(FindNameOptions::kNoKinds);
  options.find_vars = true;

  std::vector<FoundName> found;
  FindMember(FindNameContext(), options, base, identifier, nullptr, &found);
  if (!found.empty()) {
    FXL_DCHECK(found[0].kind() == FoundName::kMemberVariable);
    return found[0].member();
  }

  return Err("No member '%s' in %s '%s'.", identifier.GetFullName().c_str(), base->GetKindString(),
             base->GetFullName().c_str());
}
// A wrapper around FindMember that issues errors rather than returning an optional. The base can be
// null for the convenience of the caller. On error, the output FoundMember will be untouched.
A wrapper around FindMember that issues errors rather than returning an optional. The base can be
null for the convenience of the caller. On error, the output FoundMember will be untouched.
A wrapper around FindMember that issues errors rather than returning an optional . The base can be null for the convenience of the caller . On error the output FoundMember will be untouched .
ErrOr<FoundMember> FindMemberWithErr(const Collection* base, const ParsedIdentifier& identifier) {
  if (!base) {
    return Err("Can't resolve '%s' on non-struct/class/union value.",
               identifier.GetFullName().c_str());
  }
  FindNameOptions options(FindNameOptions::kNoKinds);
  options.find_vars = true;
  std::vector<FoundName> found;
  FindMember(FindNameContext(), options, base, identifier, nullptr, &found);
  if (!found.empty()) {
    FXL_DCHECK(found[0].kind() == FoundName::kMemberVariable);
    return found[0].member();
  }
  return Err("No member '%s' in %s '%s'.", identifier.GetFullName().c_str(), base->GetKindString(),
             base->GetFullName().c_str());
}
ErrOr < FoundMember > FindMemberWithErr ( const Collection * base , const ParsedIdentifier & identifier ) { if ( ! base ) { return Err ( " " , identifier . GetFullName ( ) . c_str ( ) ) ; } FindNameOptions options ( FindNameOptions :: kNoKinds ) ; options . find_vars = true ; std :: vector < FoundName > found ; FindMember ( FindNameContext ( ) , options , base , identifier , nullptr , & found ) ; if ( ! found . empty ( ) ) { FXL_DCHECK ( found [ 0 ] . kind ( ) == FoundName :: kMemberVariable ) ; return found [ 0 ] . member ( ) ; } return Err ( " " , identifier . GetFullName ( ) . c_str ( ) , base -> GetKindString ( ) , base -> GetFullName ( ) . c_str ( ) ) ; }
A wrapper around FindMember that issues errors rather than returning an optional.
A wrapper around FindMember that issues errors rather than returning an optional .