(type_, field)
return False
Return True if a type has the specified field.

    Arguments:
        type_: The type to examine.
            It must be one of gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION.
        field: The name of the field to look up.

    Returns:
        True if the field is present either in type_ or any baseclass.

    Raises:
        TypeError: The type is not a struct or union.
Return True if a type has the specified field.
Return True if a type has the specified field .
def has_field(type_, field):
    """Return True if a type has the specified field.

    Arguments:
        type_: The type to examine.
            It must be one of gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION.
        field: The name of the field to look up.

    Returns:
        True if the field is present either in type_ or any baseclass.

    Raises:
        TypeError: The type is not a struct or union.
    """

    type_ = get_basic_type(type_)
    if (type_.code != gdb.TYPE_CODE_STRUCT and
        type_.code != gdb.TYPE_CODE_UNION):
        raise TypeError("not a struct or union")
    for f in type_.fields():
        if f.is_base_class:
            if has_field(f.type, field):
                return True
        else:
            # NOTE: f.name could be None
            if f.name == field:
                return True
    return False
def has_field ( type_ , field ) : type_ = get_basic_type ( type_ ) if ( type_ . code != gdb . TYPE_CODE_STRUCT and type_ . code != gdb . TYPE_CODE_UNION ) : raise TypeError ( "not a struct or union" ) for f in type_ . fields ( ) : if f . is_base_class : if has_field ( f . type , field ) : return True else : # NOTE: f.name could be None if f . name == field : return True return False