(func, what, attr, nattr)
Internal worker for fetching GDB attributes.
Internal worker for fetching GDB attributes.
Internal worker for fetching GDB attributes .
def _prompt_object_attr(func, what, attr, nattr):
    """Internal worker for fetching GDB attributes."""
    if attr is None:
        attr = nattr
    try:
        obj = func()
    except gdb.error:
        return '<no %s>' % what
    if hasattr(obj, attr):
        result = getattr(obj, attr)
        if callable(result):
            result = result()
        return result
    else:
        return '<no attribute %s on current %s>' % (attr, what)
def _prompt_object_attr ( func , what , attr , nattr ) : if attr is None : attr = nattr try : obj = func ( ) except gdb . error : return '<no %s>' % what if hasattr ( obj , attr ) : result = getattr ( obj , attr ) if callable ( result ) : result = result ( ) return result else : return '<no attribute %s on current %s>' % ( attr , what )