parameters: (func, what, attr, nattr)
docstring: Internal worker for fetching GDB attributes.
docstring_summary: Internal worker for fetching GDB attributes.
docstring_tokens: Internal worker for fetching GDB attributes .
function: 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)
function_tokens: 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 )