tools/gdb/gdb_chrome.py
def yield_fields(val):
  """Use this in a printer's children() method to print an object's fields.

    e.g.
      def children():
        for result in yield_fields(self.val):
          yield result
    """
  try:
    fields = val.type.target().fields()
  except:
    fields = val.type.fields()
  for field in fields:
    if field.is_base_class:
      yield (field.name, val.cast(gdb.lookup_type(field.name)))
    else:
      yield (field.name, val[field.name])
Use this in a printer's children() method to print an object's fields.

    e.g.
      def children():
        for result in yield_fields(self.val):
          yield result
    
Use this in a printer's children() method to print an object's fields.
Use this in a printer ' s children () method to print an object ' s fields .
def yield_fields(val):
  try:
    fields = val.type.target().fields()
  except:
    fields = val.type.fields()
  for field in fields:
    if field.is_base_class:
      yield (field.name, val.cast(gdb.lookup_type(field.name)))
    else:
      yield (field.name, val[field.name])
def yield_fields ( val ) : try : fields = val . type . target ( ) . fields ( ) except : fields = val . type . fields ( ) for field in fields : if field . is_base_class : yield ( field . name , val . cast ( gdb . lookup_type ( field . name ) ) ) else : yield ( field . name , val [ field . name ] )
Use this in a printer's children() method to print an object's fields.
Use this in a printer ' s children () method to print an object ' s fields .
"""Use this in a printer's children() method to print an object's fields.

    e.g.
      def children():
        for result in yield_fields(self.val):
          yield result
    """
val