modern style classes

This commit is contained in:
Eitan Adler 2016-09-17 23:09:21 -07:00
parent 733fe1d25c
commit 22c66c4b38

View File

@ -170,7 +170,7 @@ def rust_pretty_printer_lookup_function(gdb_val):
#=------------------------------------------------------------------------------
# Pretty Printer Classes
#=------------------------------------------------------------------------------
class RustStructPrinter:
class RustStructPrinter(object):
def __init__(self, val, omit_first_field, omit_type_name, is_tuple_like):
self.__val = val
self.__omit_first_field = omit_first_field
@ -205,7 +205,7 @@ class RustStructPrinter:
return ""
class RustSlicePrinter:
class RustSlicePrinter(object):
def __init__(self, val):
self.__val = val
@ -227,7 +227,7 @@ class RustSlicePrinter:
yield (str(index), (raw_ptr + index).dereference())
class RustStringSlicePrinter:
class RustStringSlicePrinter(object):
def __init__(self, val):
self.__val = val
@ -237,7 +237,7 @@ class RustStringSlicePrinter:
return '"%s"' % raw_ptr.string(encoding="utf-8", length=length)
class RustStdVecPrinter:
class RustStdVecPrinter(object):
def __init__(self, val):
self.__val = val
@ -257,7 +257,7 @@ class RustStdVecPrinter:
yield (str(index), (gdb_ptr + index).dereference())
class RustStdStringPrinter:
class RustStdStringPrinter(object):
def __init__(self, val):
self.__val = val
@ -268,7 +268,7 @@ class RustStdStringPrinter:
length=length)
class RustCStyleVariantPrinter:
class RustCStyleVariantPrinter(object):
def __init__(self, val):
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_ENUM
self.__val = val
@ -277,7 +277,7 @@ class RustCStyleVariantPrinter:
return str(self.__val.get_wrapped_value())
class IdentityPrinter:
class IdentityPrinter(object):
def __init__(self, string):
self.string = string