diff --git a/isl-0.14/isl.py b/isl-0.14/isl.py index 6382f63..9b76f42 100644 --- a/isl-0.14/isl.py +++ b/isl-0.14/isl.py @@ -64,10 +64,10 @@ class IslPrintCommand (gdb.Command): printer = str_lookup_function(arg) if printer == None: - print "No isl printer for this type" + print("No isl printer for this type") return - print printer.to_string() + print(printer.to_string()) IslPrintCommand() diff --git a/isl-0.16.1/isl.py b/isl-0.16.1/isl.py index 6382f63..9b76f42 100644 --- a/isl-0.16.1/isl.py +++ b/isl-0.16.1/isl.py @@ -64,10 +64,10 @@ class IslPrintCommand (gdb.Command): printer = str_lookup_function(arg) if printer == None: - print "No isl printer for this type" + print("No isl printer for this type") return - print printer.to_string() + print(printer.to_string()) IslPrintCommand() diff --git a/isl-0.14/isl.py b/isl-0.14/isl.py index 9b76f42..06236ef 100644 --- a/isl-0.14/isl.py +++ b/isl-0.14/isl.py @@ -3,19 +3,19 @@ import re # GDB Pretty Printers for most isl objects class IslObjectPrinter: - """Print an isl object""" - def __init__ (self, val, type): + """Print an isl object""" + def __init__ (self, val, type): self.val = val self.type = type - def to_string (self): + def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() value = str(self.val.cast(void_ptr)) printer = gdb.parse_and_eval("isl_printer_to_str(isl_" + str(self.type) - + "_get_ctx(" + value + "))") + + "_get_ctx(" + value + "))") printer = gdb.parse_and_eval("isl_printer_print_" + str(self.type) + "(" + str(printer) + ", " @@ -25,15 +25,15 @@ class IslObjectPrinter: gdb.parse_and_eval("isl_printer_free(" + str(printer) + ")") return string - def display_hint (self): + def display_hint (self): return 'string' class IslIntPrinter: - """Print an isl_int """ - def __init__ (self, val): + """Print an isl_int """ + def __init__ (self, val): self.val = val - def to_string (self): + def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() @@ -51,7 +51,7 @@ class IslIntPrinter: gdb.parse_and_eval("isl_ctx_free(" + str(context) + ")") return string - def display_hint (self): + def display_hint (self): return 'string' class IslPrintCommand (gdb.Command): @@ -72,21 +72,21 @@ class IslPrintCommand (gdb.Command): IslPrintCommand() def str_lookup_function (val): - if val.type.code != gdb.TYPE_CODE_PTR: - if str(val.type) == "isl_int": - return IslIntPrinter(val) + if val.type.code != gdb.TYPE_CODE_PTR: + if str(val.type) == "isl_int": + return IslIntPrinter(val) else: return None - lookup_tag = val.type.target() - regex = re.compile ("^isl_(.*)$") + lookup_tag = val.type.target() + regex = re.compile ("^isl_(.*)$") - if lookup_tag == None: - return None + if lookup_tag == None: + return None - m = regex.match (str(lookup_tag)) + m = regex.match (str(lookup_tag)) - if m: + if m: # Those types of printers defined in isl. if m.group(1) in ["basic_set", "set", "union_set", "basic_map", "map", "union_map", "qpolynomial", diff --git a/isl-0.16.1/isl.py b/isl-0.16.1/isl.py index 9b76f42..06236ef 100644 --- a/isl-0.16.1/isl.py +++ b/isl-0.16.1/isl.py @@ -3,19 +3,19 @@ import re # GDB Pretty Printers for most isl objects class IslObjectPrinter: - """Print an isl object""" - def __init__ (self, val, type): + """Print an isl object""" + def __init__ (self, val, type): self.val = val self.type = type - def to_string (self): + def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() value = str(self.val.cast(void_ptr)) printer = gdb.parse_and_eval("isl_printer_to_str(isl_" + str(self.type) - + "_get_ctx(" + value + "))") + + "_get_ctx(" + value + "))") printer = gdb.parse_and_eval("isl_printer_print_" + str(self.type) + "(" + str(printer) + ", " @@ -25,15 +25,15 @@ class IslObjectPrinter: gdb.parse_and_eval("isl_printer_free(" + str(printer) + ")") return string - def display_hint (self): + def display_hint (self): return 'string' class IslIntPrinter: - """Print an isl_int """ - def __init__ (self, val): + """Print an isl_int """ + def __init__ (self, val): self.val = val - def to_string (self): + def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() @@ -51,7 +51,7 @@ class IslIntPrinter: gdb.parse_and_eval("isl_ctx_free(" + str(context) + ")") return string - def display_hint (self): + def display_hint (self): return 'string' class IslPrintCommand (gdb.Command): @@ -72,21 +72,21 @@ class IslPrintCommand (gdb.Command): IslPrintCommand() def str_lookup_function (val): - if val.type.code != gdb.TYPE_CODE_PTR: - if str(val.type) == "isl_int": - return IslIntPrinter(val) + if val.type.code != gdb.TYPE_CODE_PTR: + if str(val.type) == "isl_int": + return IslIntPrinter(val) else: return None - lookup_tag = val.type.target() - regex = re.compile ("^isl_(.*)$") + lookup_tag = val.type.target() + regex = re.compile ("^isl_(.*)$") - if lookup_tag == None: - return None + if lookup_tag == None: + return None - m = regex.match (str(lookup_tag)) + m = regex.match (str(lookup_tag)) - if m: + if m: # Those types of printers defined in isl. if m.group(1) in ["basic_set", "set", "union_set", "basic_map", "map", "union_map", "qpolynomial",