python black formatter was complaining about the formatting of
gdb.python/py-typeprint.py, so this commit corrects it.
import gdb
+
class StringRecognizer(object):
def __init__(self):
self.enabled = True
gdb.type_printers.append(StringTypePrinter())
+
class OtherRecognizer(object):
def __init__(self):
self.enabled = True
def recognize(self, type_obj):
- if type_obj.tag == 'Other':
- return 'Another'
+ if type_obj.tag == "Other":
+ return "Another"
return None
+
class OtherTypePrinter(object):
def __init__(self):
- self.name = 'other'
+ self.name = "other"
self.enabled = True
def instantiate(self):
return OtherRecognizer()
+
import gdb.types
+
gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter())