def _UnpackGdbVal(self, gdb_value):
    """Unpacks gdb.Value objects and returns the best-matched python object."""
    val_type = gdb_value.type.code
    if val_type == gdb.TYPE_CODE_INT or val_type == gdb.TYPE_CODE_ENUM:
      return int(gdb_value)
    if val_type == gdb.TYPE_CODE_VOID:
      return None
    if val_type == gdb.TYPE_CODE_PTR:
      return long(gdb_value)
    if val_type == gdb.TYPE_CODE_ARRAY:
      # This is probably a string
      return str(gdb_value)
    # I'm out of ideas, let's return it as a string
    return str(gdb_value)
def _UnpackGdbVal ( self , gdb_value ) : val_type = gdb_value . type . code if val_type == gdb . TYPE_CODE_INT or val_type == gdb . TYPE_CODE_ENUM : return int ( gdb_value ) if val_type == gdb . TYPE_CODE_VOID : return None if val_type == gdb . TYPE_CODE_PTR : return long ( gdb_value ) if val_type == gdb . TYPE_CODE_ARRAY : return str ( gdb_value ) return str ( gdb_value )
Unpacks gdb.Value objects and returns the best-matched python object.